Skip to content

Commit

Permalink
Add capAppName to appDef.tags
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Nov 20, 2023
1 parent 767ed04 commit 082f8a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/containers/apps/oneclick/OneClickAppDeployManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from '../../../models/IOneClickAppModels'
import Utils from '../../../utils/Utils'
import OneClickAppDeploymentHelper from './OneClickAppDeploymentHelper'
import { ONE_CLICK_APP_NAME_VAR_NAME } from './variables/OneClickAppConfigPage'

interface IDeploymentStep {
stepName: string
Expand Down Expand Up @@ -90,12 +91,14 @@ export default class OneClickAppDeployManager {
})
} else {
const steps: IDeploymentStep[] = []
const capAppName = values[ONE_CLICK_APP_NAME_VAR_NAME]
for (let index = 0; index < apps.length; index++) {
const appToDeploy = apps[index]
steps.push(
...self.createDeploymentStepPromises(
appToDeploy.appName,
appToDeploy.service
appToDeploy.service,
capAppName
)
)
}
Expand Down Expand Up @@ -207,7 +210,8 @@ export default class OneClickAppDeployManager {

private createDeploymentStepPromises(
appName: string,
dockerComposeService: IDockerComposeService
dockerComposeService: IDockerComposeService,
capAppName: string
): IDeploymentStep[] {
const promises: IDeploymentStep[] = []
const self = this
Expand All @@ -227,7 +231,8 @@ export default class OneClickAppDeployManager {
stepPromise: function () {
return self.deploymentHelper.createConfigurationPromise(
appName,
dockerComposeService
dockerComposeService,
capAppName
)
},
})
Expand Down
8 changes: 7 additions & 1 deletion src/containers/apps/oneclick/OneClickAppDeploymentHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default class OneClickAppDeploymentHelper {

createConfigurationPromise(
appName: string,
dockerComposeService: IDockerComposeService
dockerComposeService: IDockerComposeService,
capAppName: string
) {
const self = this
return Promise.resolve().then(function () {
Expand All @@ -48,6 +49,11 @@ export default class OneClickAppDeploymentHelper {
}

appDef.volumes = appDef.volumes || []
appDef.tags = [
{
tagName: capAppName,
},
]

const vols = dockerComposeService.volumes || []
for (let i = 0; i < vols.length; i++) {
Expand Down

0 comments on commit 082f8a6

Please sign in to comment.