forked from coop-cloud/abra
fix: only update when really needed
This commit is contained in:
parent
c13f438580
commit
06cc5d1cc3
|
@ -46,6 +46,10 @@ recipes.
|
|||
app := internal.ValidateApp(c)
|
||||
stackName := app.StackName()
|
||||
|
||||
if err := recipe.EnsureUpToDate(app.Type); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
r, err := recipe.Get(app.Type)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
|
|
|
@ -50,6 +50,10 @@ recipes.
|
|||
app := internal.ValidateApp(c)
|
||||
stackName := app.StackName()
|
||||
|
||||
if err := recipe.EnsureUpToDate(app.Type); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
r, err := recipe.Get(app.Type)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
|
|
|
@ -23,6 +23,10 @@ func DeployAction(c *cli.Context) error {
|
|||
app := ValidateApp(c)
|
||||
stackName := app.StackName()
|
||||
|
||||
if err := recipe.EnsureUpToDate(app.Type); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
r, err := recipe.Get(app.Type)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
abraFormatter "coopcloud.tech/abra/cli/formatter"
|
||||
"coopcloud.tech/abra/pkg/config"
|
||||
"coopcloud.tech/abra/pkg/recipe"
|
||||
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
||||
"coopcloud.tech/abra/pkg/secret"
|
||||
"coopcloud.tech/abra/pkg/ssh"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
|
@ -111,6 +112,10 @@ func ensureAppNameFlag() error {
|
|||
func NewAction(c *cli.Context) error {
|
||||
recipe := ValidateRecipeWithPrompt(c)
|
||||
|
||||
if err := recipePkg.EnsureUpToDate(recipe.Name); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ensureServerFlag(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@ func ValidateRecipe(c *cli.Context) recipe.Recipe {
|
|||
}
|
||||
}
|
||||
|
||||
if err := recipe.EnsureUpToDate(recipeName); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
logrus.Debugf("validated %s as recipe argument", recipeName)
|
||||
|
||||
return chosenRecipe
|
||||
|
@ -102,10 +98,6 @@ func ValidateRecipeWithPrompt(c *cli.Context) recipe.Recipe {
|
|||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := recipe.EnsureUpToDate(chosenRecipe.Name); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
logrus.Debugf("validated %s as recipe argument", recipeName)
|
||||
|
||||
return chosenRecipe
|
||||
|
@ -133,10 +125,6 @@ func ValidateApp(c *cli.Context) config.App {
|
|||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := recipe.EnsureUpToDate(app.Type); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ssh.EnsureHostKey(app.Server); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/lint"
|
||||
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
@ -21,6 +22,10 @@ var recipeLintCommand = &cli.Command{
|
|||
Action: func(c *cli.Context) error {
|
||||
recipe := internal.ValidateRecipe(c)
|
||||
|
||||
if err := recipePkg.EnsureUpToDate(recipe.Name); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
tableCol := []string{"ref", "rule", "satisfied", "severity", "resolve"}
|
||||
table := formatter.CreateTable(tableCol)
|
||||
|
||||
|
|
Loading…
Reference in New Issue