forked from toolshed/abra
fix: more reliable syncing
This commit is contained in:
@ -177,28 +177,11 @@ will know that things are likely to change.
|
||||
}
|
||||
|
||||
mainService := "app"
|
||||
var services []string
|
||||
hasAppService := false
|
||||
for _, service := range recipe.Config.Services {
|
||||
services = append(services, service.Name)
|
||||
if service.Name == "app" {
|
||||
hasAppService = true
|
||||
logrus.Debugf("detected app service in %s", recipe.Name)
|
||||
}
|
||||
}
|
||||
|
||||
if !hasAppService {
|
||||
logrus.Fatalf("%s has no main app service?", recipe.Name)
|
||||
}
|
||||
|
||||
logrus.Debugf("selecting %s as the service to sync version label", mainService)
|
||||
|
||||
label := fmt.Sprintf("coop-cloud.${STACK_NAME}.version=%s", nextTag)
|
||||
if !internal.Dry {
|
||||
if err := recipe.UpdateLabel(mainService, label); err != nil {
|
||||
if err := recipe.UpdateLabel("compose.y*ml", mainService, label); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
logrus.Infof("synced label %s to service %s", label, mainService)
|
||||
} else {
|
||||
logrus.Infof("dry run: not syncing label %s for recipe %s", nextTag, recipe.Name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user