fix: ensure we have version checked out on deploy
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
62cc7ef92d
commit
9526d1fde6
@ -81,6 +81,11 @@ recipes.
|
|||||||
logrus.Fatal(err)
|
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 {
|
if internal.Chaos {
|
||||||
|
@ -109,6 +109,15 @@ func EnsureExists(recipe string) error {
|
|||||||
func EnsureVersion(recipeName, version string) error {
|
func EnsureVersion(recipeName, version string) error {
|
||||||
recipeDir := path.Join(config.ABRA_DIR, "apps", recipeName)
|
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)
|
repo, err := git.PlainOpen(recipeDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user