add a label to signal that a deploy is a chaos deploy
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
This commit is contained in:
parent
50db39424c
commit
c4560023d1
@ -180,6 +180,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)
|
||||||
|
|
||||||
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(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)
|
||||||
|
|
||||||
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(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)
|
||||||
|
|
||||||
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)
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/schollz/progressbar/v3"
|
"github.com/schollz/progressbar/v3"
|
||||||
@ -476,3 +477,14 @@ func SetRecipeLabel(compose *composetypes.Config, stackName string, recipe strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add a label to signal that a deploy is a chaos deploy
|
||||||
|
func SetChaosLabel(compose *composetypes.Config, stackName string, chaos bool) {
|
||||||
|
for _, service := range compose.Services {
|
||||||
|
if service.Name == "app" {
|
||||||
|
logrus.Debugf("set chaos label to %s", chaos)
|
||||||
|
labelKey := fmt.Sprintf("coop-cloud.%s.chaos", stackName)
|
||||||
|
service.Deploy.Labels[labelKey] = strconv.FormatBool(chaos)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user