fix: write versions on deploy/upgrade/rollback
See coop-cloud/organising#625
This commit is contained in:
parent
cf14731b46
commit
56068362e8
@ -55,13 +55,15 @@ EXAMPLE:
|
||||
stackName := app.StackName()
|
||||
|
||||
specificVersion := c.Args().Get(1)
|
||||
if specificVersion == "" {
|
||||
specificVersion = app.Recipe.Version
|
||||
}
|
||||
if specificVersion != "" && internal.Chaos {
|
||||
log.Fatal("cannot use <version> and --chaos together")
|
||||
}
|
||||
|
||||
if specificVersion == "" && app.Recipe.Version != "" {
|
||||
log.Debugf("retrieved %s as version from env file", app.Recipe.Version)
|
||||
specificVersion = app.Recipe.Version
|
||||
}
|
||||
|
||||
if err := app.Recipe.Ensure(internal.Chaos, internal.Offline); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@ -246,12 +248,15 @@ EXAMPLE:
|
||||
}
|
||||
}
|
||||
|
||||
if app.Recipe.Version != "" && specificVersion != "" && specificVersion != app.Recipe.Version {
|
||||
err := app.WriteRecipeVersion(specificVersion)
|
||||
if err != nil {
|
||||
app.Recipe.Version = version
|
||||
if chaosVersion != config.CHAOS_DEFAULT {
|
||||
app.Recipe.Version = chaosVersion
|
||||
}
|
||||
log.Debugf("choosing %s as version to save to env file", app.Recipe.Version)
|
||||
if err := app.WriteRecipeVersion(app.Recipe.Version); err != nil {
|
||||
log.Fatalf("writing new recipe version in env file: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
@ -219,12 +219,11 @@ EXAMPLE:
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if app.Recipe.Version != "" {
|
||||
err := app.WriteRecipeVersion(chosenDowngrade)
|
||||
if err != nil {
|
||||
app.Recipe.Version = chosenDowngrade
|
||||
log.Debugf("choosing %s as version to save to env file", app.Recipe.Version)
|
||||
if err := app.WriteRecipeVersion(app.Recipe.Version); err != nil {
|
||||
log.Fatalf("writing new recipe version in env file: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
@ -279,12 +279,11 @@ EXAMPLE:
|
||||
}
|
||||
}
|
||||
|
||||
if app.Recipe.Version != "" {
|
||||
err := app.WriteRecipeVersion(chosenUpgrade)
|
||||
if err != nil {
|
||||
app.Recipe.Version = chosenUpgrade
|
||||
log.Debugf("choosing %s as version to save to env file", app.Recipe.Version)
|
||||
if err := app.WriteRecipeVersion(app.Recipe.Version); err != nil {
|
||||
log.Fatalf("writing new recipe version in env file: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user