new package envfile and move GetComposeFiles to recipe package

This commit is contained in:
2024-07-06 16:13:17 +02:00
parent 37aff723c0
commit 0076b31253
15 changed files with 128 additions and 114 deletions

View File

@ -6,6 +6,7 @@ import (
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/autocomplete"
"coopcloud.tech/abra/pkg/envfile"
"coopcloud.tech/abra/pkg/secret"
appPkg "coopcloud.tech/abra/pkg/app"
@ -179,7 +180,7 @@ recipes.
}
abraShPath := fmt.Sprintf("%s/%s/%s", config.RECIPES_DIR, app.Recipe, "abra.sh")
abraShEnv, err := appPkg.ReadAbraShEnvVars(abraShPath)
abraShEnv, err := envfile.ReadAbraShEnvVars(abraShPath)
if err != nil {
logrus.Fatal(err)
}
@ -187,7 +188,7 @@ recipes.
app.Env[k] = v
}
composeFiles, err := appPkg.GetComposeFiles(app.Recipe, app.Env)
composeFiles, err := recipe.GetComposeFiles(app.Recipe, app.Env)
if err != nil {
logrus.Fatal(err)
}

View File

@ -136,7 +136,7 @@ var appNewCommand = cli.Command{
logrus.Fatal(err)
}
composeFiles, err := appPkg.GetComposeFiles(recipe.Name, sampleEnv)
composeFiles, err := recipePkg.GetComposeFiles(recipe.Name, sampleEnv)
if err != nil {
logrus.Fatal(err)
}

View File

@ -79,7 +79,7 @@ var appPsCommand = cli.Command{
// showPSOutput renders ps output.
func showPSOutput(c *cli.Context, app appPkg.App, cl *dockerClient.Client) {
composeFiles, err := appPkg.GetComposeFiles(app.Recipe, app.Env)
composeFiles, err := recipe.GetComposeFiles(app.Recipe, app.Env)
if err != nil {
logrus.Fatal(err)
return

View File

@ -7,6 +7,7 @@ import (
appPkg "coopcloud.tech/abra/pkg/app"
"coopcloud.tech/abra/pkg/autocomplete"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/envfile"
"coopcloud.tech/abra/pkg/lint"
"coopcloud.tech/abra/pkg/recipe"
stack "coopcloud.tech/abra/pkg/upstream/stack"
@ -199,7 +200,7 @@ recipes.
}
abraShPath := fmt.Sprintf("%s/%s/%s", config.RECIPES_DIR, app.Recipe, "abra.sh")
abraShEnv, err := appPkg.ReadAbraShEnvVars(abraShPath)
abraShEnv, err := envfile.ReadAbraShEnvVars(abraShPath)
if err != nil {
logrus.Fatal(err)
}
@ -207,7 +208,7 @@ recipes.
app.Env[k] = v
}
composeFiles, err := appPkg.GetComposeFiles(app.Recipe, app.Env)
composeFiles, err := recipe.GetComposeFiles(app.Recipe, app.Env)
if err != nil {
logrus.Fatal(err)
}

View File

@ -87,7 +87,7 @@ var appSecretGenerateCommand = cli.Command{
internal.ShowSubcommandHelpAndError(c, err)
}
composeFiles, err := appPkg.GetComposeFiles(app.Recipe, app.Env)
composeFiles, err := recipe.GetComposeFiles(app.Recipe, app.Env)
if err != nil {
logrus.Fatal(err)
}
@ -284,7 +284,7 @@ Example:
}
}
composeFiles, err := appPkg.GetComposeFiles(app.Recipe, app.Env)
composeFiles, err := recipe.GetComposeFiles(app.Recipe, app.Env)
if err != nil {
logrus.Fatal(err)
}

View File

@ -9,6 +9,7 @@ import (
"coopcloud.tech/abra/pkg/autocomplete"
"coopcloud.tech/abra/pkg/client"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/envfile"
"coopcloud.tech/abra/pkg/lint"
"coopcloud.tech/abra/pkg/recipe"
recipePkg "coopcloud.tech/abra/pkg/recipe"
@ -233,7 +234,7 @@ recipes.
}
abraShPath := fmt.Sprintf("%s/%s/%s", config.RECIPES_DIR, app.Recipe, "abra.sh")
abraShEnv, err := appPkg.ReadAbraShEnvVars(abraShPath)
abraShEnv, err := envfile.ReadAbraShEnvVars(abraShPath)
if err != nil {
logrus.Fatal(err)
}
@ -241,7 +242,7 @@ recipes.
app.Env[k] = v
}
composeFiles, err := appPkg.GetComposeFiles(app.Recipe, app.Env)
composeFiles, err := recipePkg.GetComposeFiles(app.Recipe, app.Env)
if err != nil {
logrus.Fatal(err)
}