fix: ensure we have version checked out on deploy
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
62cc7ef92d
commit
9526d1fde6
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue