add env ENABLE_AUTO_UPDATE as label to enable/disable the auto update process
continuous-integration/drone/pr Build was killed
Details
continuous-integration/drone/pr Build was killed
Details
This commit is contained in:
parent
ebb86391af
commit
6774893412
|
@ -181,6 +181,7 @@ recipes.
|
||||||
config.ExposeAllEnv(stackName, compose, app.Env)
|
config.ExposeAllEnv(stackName, compose, app.Env)
|
||||||
config.SetRecipeLabel(compose, stackName, app.Recipe)
|
config.SetRecipeLabel(compose, stackName, app.Recipe)
|
||||||
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
||||||
|
config.SetUpdateLabel(compose, stackName, app.Env)
|
||||||
|
|
||||||
if !internal.Force {
|
if !internal.Force {
|
||||||
if err := internal.NewVersionOverview(app, deployedVersion, chosenDowngrade, ""); err != nil {
|
if err := internal.NewVersionOverview(app, deployedVersion, chosenDowngrade, ""); err != nil {
|
||||||
|
|
|
@ -192,6 +192,7 @@ recipes.
|
||||||
config.ExposeAllEnv(stackName, compose, app.Env)
|
config.ExposeAllEnv(stackName, compose, app.Env)
|
||||||
config.SetRecipeLabel(compose, stackName, app.Recipe)
|
config.SetRecipeLabel(compose, stackName, app.Recipe)
|
||||||
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
||||||
|
config.SetUpdateLabel(compose, stackName, app.Env)
|
||||||
|
|
||||||
if err := internal.NewVersionOverview(app, deployedVersion, chosenUpgrade, releaseNotes); err != nil {
|
if err := internal.NewVersionOverview(app, deployedVersion, chosenUpgrade, releaseNotes); err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
|
|
|
@ -137,6 +137,7 @@ func DeployAction(c *cli.Context) error {
|
||||||
config.ExposeAllEnv(app.StackName(), compose, app.Env)
|
config.ExposeAllEnv(app.StackName(), compose, app.Env)
|
||||||
config.SetRecipeLabel(compose, app.StackName(), app.Recipe)
|
config.SetRecipeLabel(compose, app.StackName(), app.Recipe)
|
||||||
config.SetChaosLabel(compose, app.StackName(), Chaos)
|
config.SetChaosLabel(compose, app.StackName(), Chaos)
|
||||||
|
config.SetUpdateLabel(compose, app.StackName(), app.Env)
|
||||||
|
|
||||||
if err := DeployOverview(app, version, "continue with deployment?"); err != nil {
|
if err := DeployOverview(app, version, "continue with deployment?"); err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
|
|
|
@ -489,3 +489,18 @@ func SetChaosLabel(compose *composetypes.Config, stackName string, chaos bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add env ENABLE_AUTO_UPDATE as label to enable/disable the auto update process for this app
|
||||||
|
func SetUpdateLabel(compose *composetypes.Config, stackName string, appEnv AppEnv) {
|
||||||
|
for _, service := range compose.Services {
|
||||||
|
if service.Name == "app" {
|
||||||
|
enable_auto_update, exists := appEnv["ENABLE_AUTO_UPDATE"]
|
||||||
|
if !exists {
|
||||||
|
enable_auto_update = "false"
|
||||||
|
}
|
||||||
|
logrus.Debugf("set auto update label to %s", enable_auto_update)
|
||||||
|
labelKey := fmt.Sprintf("coop-cloud.%s.autoupdate", stackName)
|
||||||
|
service.Deploy.Labels[labelKey] = enable_auto_update
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue