feat: upgrade/downgrade support chaos mode
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-10-18 08:57:25 +02:00
parent c5a7a831d2
commit 62cc7ef92d
4 changed files with 75 additions and 39 deletions

View File

@ -10,7 +10,6 @@ import (
"coopcloud.tech/abra/pkg/client"
stack "coopcloud.tech/abra/pkg/client/stack"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/git"
"coopcloud.tech/abra/pkg/recipe"
"github.com/AlecAivazis/survey/v2"
"github.com/sirupsen/logrus"
@ -86,21 +85,11 @@ recipes.
if internal.Chaos {
logrus.Warnf("chaos mode engaged")
head, err := git.GetRecipeHead(app.Type)
var err error
version, err = recipe.ChaosVersion(app.Type)
if err != nil {
logrus.Fatal(err)
}
version = head.String()[:8]
isClean, err := git.IsClean(app.Type)
if err != nil {
logrus.Fatal(err)
}
if !isClean {
version = fmt.Sprintf("%s + unstaged changes", version)
}
}
abraShPath := fmt.Sprintf("%s/%s/%s", config.APPS_DIR, app.Type, "abra.sh")