Skip to content

Commit c637318

Browse files
authored
Merge pull request caprover#1740 from caprover/app-tags
App tags
2 parents 5a64fb8 + d7a9997 commit c637318

File tree

7 files changed

+13
-2
lines changed

7 files changed

+13
-2
lines changed

dockerfile-captain.edge

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM node:18
2-
RUN curl -Iv https://registry.yarnpkg.com
32
RUN apt-get update && apt-get full-upgrade -yqq && apt-get install build-essential cmake -yqq
43

54
RUN mkdir -p /usr/src/app

dockerfile-captain.release

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM node:18
2-
RUN curl -Iv https://registry.yarnpkg.com
32
RUN apt-get update && apt-get full-upgrade -yqq && apt-get install build-essential cmake -yqq
43

54
RUN mkdir -p /usr/src/app

src/datastore/AppsDataStore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ class AppsDataStore {
605605
captainDefinitionRelativeFilePath: string,
606606
envVars: IAppEnvVar[],
607607
volumes: IAppVolume[],
608+
tags: IAppTag[],
608609
nodeId: string,
609610
notExposeAsWebApp: boolean,
610611
containerHttpPort: number,
@@ -691,6 +692,7 @@ class AppsDataStore {
691692
appObj.preDeployFunction = preDeployFunction
692693
appObj.serviceUpdateOverride = serviceUpdateOverride
693694
appObj.description = description
695+
appObj.tags = tags
694696

695697
appObj.appDeployTokenConfig = {
696698
enabled: !!appDeployTokenConfig.enabled,
@@ -879,6 +881,7 @@ class AppsDataStore {
879881
envVars: [],
880882
volumes: [],
881883
ports: [],
884+
tags: [],
882885
versions: [],
883886
deployedVersion: 0,
884887
notExposeAsWebApp: false,

src/models/AppDefinition.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ interface IAppCustomDomain {
4848
hasSsl: boolean
4949
}
5050

51+
interface IAppTag {
52+
tagName: string
53+
}
54+
5155
interface IAppDefinitionBase {
5256
description: string
5357
deployedVersion: number
@@ -65,6 +69,7 @@ interface IAppDefinitionBase {
6569
customNginxConfig?: string
6670
networks: string[]
6771
customDomain: IAppCustomDomain[]
72+
tags?: IAppTag[]
6873
ports: IAppPort[]
6974
volumes: IAppVolume[]
7075
envVars: IAppEnvVar[]

src/routes/user/apps/appdefinition/AppDefinitionRouter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ router.post('/update/', function (req, res, next) {
316316
const captainDefinitionRelativeFilePath =
317317
req.body.captainDefinitionRelativeFilePath
318318
const notExposeAsWebApp = req.body.notExposeAsWebApp
319+
const tags = req.body.tags || []
319320
const customNginxConfig = req.body.customNginxConfig
320321
const forceSsl = !!req.body.forceSsl
321322
const websocketSupport = !!req.body.websocketSupport
@@ -389,6 +390,7 @@ router.post('/update/', function (req, res, next) {
389390
captainDefinitionRelativeFilePath,
390391
envVars,
391392
volumes,
393+
tags,
392394
nodeId,
393395
notExposeAsWebApp,
394396
containerHttpPort,

src/user/ServiceManager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ class ServiceManager {
643643
captainDefinitionRelativeFilePath: string,
644644
envVars: IAppEnvVar[],
645645
volumes: IAppVolume[],
646+
tags: IAppTag[],
646647
nodeId: string,
647648
notExposeAsWebApp: boolean,
648649
containerHttpPort: number,
@@ -762,6 +763,7 @@ class ServiceManager {
762763
captainDefinitionRelativeFilePath,
763764
envVars,
764765
volumes,
766+
tags,
765767
nodeId,
766768
notExposeAsWebApp,
767769
containerHttpPort,

src/utils/MigrateCaptainDuckDuck.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ export default class MigrateCaptainDuckDuck {
327327
CaptainConstants.defaultCaptainDefinitionPath,
328328
app.envVars || [],
329329
app.volumes || [],
330+
[],
330331
app.nodeId || '',
331332
!!app.notExposeAsWebApp,
332333
80,

0 commit comments

Comments
 (0)