fix: ensure we have version checked out on deploy
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2021-10-18 09:30:43 +02:00
parent 62cc7ef92d
commit 9526d1fde6
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 14 additions and 0 deletions

View File

@ -81,6 +81,11 @@ recipes.
logrus.Fatal(err)
}
}
} else {
logrus.Infof("choosing '%s' as version to deploy", version)
if err := recipe.EnsureVersion(app.Type, version); err != nil {
logrus.Fatal(err)
}
}
if internal.Chaos {

View File

@ -109,6 +109,15 @@ func EnsureExists(recipe string) error {
func EnsureVersion(recipeName, version string) error {
recipeDir := path.Join(config.ABRA_DIR, "apps", recipeName)
isClean, err := gitPkg.IsClean(recipeName)
if err != nil {
return err
}
if !isClean {
return fmt.Errorf("'%s' has locally unstaged changes", recipeName)
}
repo, err := git.PlainOpen(recipeDir)
if err != nil {
return err