forked from toolshed/abra
Set chaos version label for each deployed or upgraded app
This commit is contained in:
@ -499,6 +499,17 @@ func SetChaosLabel(compose *composetypes.Config, stackName string, chaos bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// SetChaosVersionLabel adds the label 'coop-cloud.${STACK_NAME}.chaos_version=$(GIT_COMMIT)' to the app container
|
||||
func SetChaosVersionLabel(compose *composetypes.Config, stackName string, chaosVersion string) {
|
||||
for _, service := range compose.Services {
|
||||
if service.Name == "app" {
|
||||
logrus.Debugf("set label 'coop-cloud.%s.chaos_version' to %v for %s", stackName, chaosVersion, stackName)
|
||||
labelKey := fmt.Sprintf("coop-cloud.%s.chaos_version", stackName)
|
||||
service.Deploy.Labels[labelKey] = chaosVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SetUpdateLabel adds env ENABLE_AUTO_UPDATE as label to enable/disable the
|
||||
// auto update process for this app. The default if this variable is not set is to disable
|
||||
// the auto update process.
|
||||
|
Reference in New Issue
Block a user