forked from toolshed/abra
		
	fix: ensure we have version checked out on deploy
This commit is contained in:
		| @ -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 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user