forked from toolshed/abra
add env ENABLE_AUTO_UPDATE as label to enable/disable the auto update process
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user