forked from coop-cloud/abra
add a label to signal that a deploy is connected with a recipe
This commit is contained in:
parent
af7f0ee391
commit
22051e7179
|
@ -180,6 +180,7 @@ recipes.
|
||||||
}
|
}
|
||||||
config.ExposeAllEnv(compose, app.Env)
|
config.ExposeAllEnv(compose, app.Env)
|
||||||
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
||||||
|
config.SetRecipeLabel(compose, stackName, app.Recipe)
|
||||||
|
|
||||||
if !internal.Force {
|
if !internal.Force {
|
||||||
if err := internal.NewVersionOverview(app, deployedVersion, chosenDowngrade, ""); err != nil {
|
if err := internal.NewVersionOverview(app, deployedVersion, chosenDowngrade, ""); err != nil {
|
||||||
|
|
|
@ -191,6 +191,7 @@ recipes.
|
||||||
}
|
}
|
||||||
config.ExposeAllEnv(compose, app.Env)
|
config.ExposeAllEnv(compose, app.Env)
|
||||||
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
config.SetChaosLabel(compose, stackName, internal.Chaos)
|
||||||
|
config.SetRecipeLabel(compose, stackName, app.Recipe)
|
||||||
|
|
||||||
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)
|
||||||
|
|
|
@ -136,6 +136,7 @@ func DeployAction(c *cli.Context) error {
|
||||||
}
|
}
|
||||||
config.ExposeAllEnv(compose, app.Env)
|
config.ExposeAllEnv(compose, app.Env)
|
||||||
config.SetChaosLabel(compose, app.StackName(), Chaos)
|
config.SetChaosLabel(compose, app.StackName(), Chaos)
|
||||||
|
config.SetRecipeLabel(compose, app.StackName(), app.Recipe)
|
||||||
|
|
||||||
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)
|
||||||
|
|
|
@ -237,6 +237,8 @@ func upgrade(cl *dockerclient.Client, stackName string, recipeName string) {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
}
|
}
|
||||||
config.ExposeAllEnv(compose, app.Env)
|
config.ExposeAllEnv(compose, app.Env)
|
||||||
|
// config.SetChaosLabel(compose, stackName, internal.Chaos)
|
||||||
|
// config.SetRecipeLabel(compose, stackName, app.Recipe)
|
||||||
|
|
||||||
if err := stack.RunDeploy(cl, deployOpts, compose, stackName, true); err != nil {
|
if err := stack.RunDeploy(cl, deployOpts, compose, stackName, true); err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
|
|
|
@ -473,3 +473,14 @@ func SetChaosLabel(compose *composetypes.Config, stackName string, chaos bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add a label to signal that a deploy is connected with a recipe
|
||||||
|
func SetRecipeLabel(compose *composetypes.Config, stackName string, recipe string) {
|
||||||
|
for _, service := range compose.Services {
|
||||||
|
if service.Name == "app" {
|
||||||
|
logrus.Debugf("set recipe label to %s", recipe)
|
||||||
|
labelKey := fmt.Sprintf("coop-cloud.%s.recipe", stackName)
|
||||||
|
service.Deploy.Labels[labelKey] = recipe
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue