forked from toolshed/abra
refactor: consolidate recipe in-place editing functions
This commit is contained in:
@ -8,8 +8,6 @@ import (
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/catalogue"
|
||||
"coopcloud.tech/abra/pkg/client"
|
||||
"coopcloud.tech/abra/pkg/compose"
|
||||
"coopcloud.tech/abra/pkg/config"
|
||||
"coopcloud.tech/abra/pkg/recipe"
|
||||
"coopcloud.tech/tagcmp"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
@ -38,12 +36,12 @@ This is step 1 of upgrading a recipe. Step 2 is running "abra recipe sync
|
||||
Action: func(c *cli.Context) error {
|
||||
recipeName := internal.ValidateRecipe(c)
|
||||
|
||||
composeConfig, err := recipe.GetComposeConfig(recipeName)
|
||||
recipe, err := recipe.Get(recipeName)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
for _, service := range composeConfig.Services {
|
||||
for _, service := range recipe.Config.Services {
|
||||
catlVersions, err := catalogue.VersionsOfService(recipeName, service.Name)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
@ -129,8 +127,7 @@ This is step 1 of upgrading a recipe. Step 2 is running "abra recipe sync
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
pattern := fmt.Sprintf("%s/%s/compose**yml", config.APPS_DIR, recipeName)
|
||||
if err := compose.UpdateTag(pattern, image, upgradeTag); err != nil {
|
||||
if err := recipe.UpdateTag(image, upgradeTag); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user