forked from toolshed/abra
refactor(recipe): remove remaining usage of old recipe struct
This commit is contained in:
@ -30,7 +30,7 @@ func NewVersionOverview(app appPkg.App, currentVersion, newVersion, releaseNotes
|
||||
server = "local"
|
||||
}
|
||||
|
||||
table.Append([]string{server, app.Recipe, deployConfig, app.Domain, currentVersion, newVersion})
|
||||
table.Append([]string{server, app.Recipe.Name, deployConfig, app.Domain, currentVersion, newVersion})
|
||||
table.Render()
|
||||
|
||||
if releaseNotes != "" && newVersion != "" {
|
||||
@ -84,7 +84,7 @@ func GetReleaseNotes(recipeName, version string) (string, error) {
|
||||
// the commands string must have the following format:
|
||||
// "<service> <command> <arguments>|<service> <command> <arguments>|... "
|
||||
func PostCmds(cl *dockerClient.Client, app appPkg.App, commands string) error {
|
||||
abraSh := path.Join(config.RECIPES_DIR, app.Recipe, "abra.sh")
|
||||
abraSh := path.Join(config.RECIPES_DIR, app.Recipe.Name, "abra.sh")
|
||||
if _, err := os.Stat(abraSh); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return fmt.Errorf(fmt.Sprintf("%s does not exist for %s?", abraSh, app.Name))
|
||||
@ -105,7 +105,7 @@ func PostCmds(cl *dockerClient.Client, app appPkg.App, commands string) error {
|
||||
}
|
||||
log.Infof("running post-command '%s %s' in container %s", cmdName, parsedCmdArgs, targetServiceName)
|
||||
|
||||
if err := EnsureCommand(abraSh, app.Recipe, cmdName); err != nil {
|
||||
if err := EnsureCommand(abraSh, app.Recipe.Name, cmdName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ func DeployOverview(app appPkg.App, version, message string) error {
|
||||
server = "local"
|
||||
}
|
||||
|
||||
table.Append([]string{server, app.Recipe, deployConfig, app.Domain, version})
|
||||
table.Append([]string{server, app.Recipe.Name, deployConfig, app.Domain, version})
|
||||
table.Render()
|
||||
|
||||
if NoInput {
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// ValidateRecipe ensures the recipe arg is valid.
|
||||
func ValidateRecipe(c *cli.Context) recipe.Recipe {
|
||||
func ValidateRecipe(c *cli.Context) recipe.Recipe2 {
|
||||
recipeName := c.Args().First()
|
||||
|
||||
if recipeName == "" && !NoInput {
|
||||
@ -57,7 +57,12 @@ func ValidateRecipe(c *cli.Context) recipe.Recipe {
|
||||
ShowSubcommandHelpAndError(c, errors.New("no recipe name provided"))
|
||||
}
|
||||
|
||||
chosenRecipe, err := recipe.Get(recipeName, Offline)
|
||||
chosenRecipe := recipe.Get2(recipeName)
|
||||
err := chosenRecipe.EnsureExists()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
_, err = chosenRecipe.GetComposeConfig(nil)
|
||||
if err != nil {
|
||||
if c.Command.Name == "generate" {
|
||||
if strings.Contains(err.Error(), "missing a compose") {
|
||||
|
Reference in New Issue
Block a user