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

@ -12,10 +12,10 @@ import (
"strconv"
"strings"
"coopcloud.tech/abra/pkg/app"
"coopcloud.tech/abra/pkg/catalogue"
"coopcloud.tech/abra/pkg/compose"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/envfile"
"coopcloud.tech/abra/pkg/formatter"
gitPkg "coopcloud.tech/abra/pkg/git"
"coopcloud.tech/abra/pkg/limit"
@ -228,7 +228,7 @@ func Get(recipeName string, offline bool) (Recipe, error) {
}
envSamplePath := path.Join(config.RECIPES_DIR, recipeName, ".env.sample")
sampleEnv, err := app.ReadEnv(envSamplePath)
sampleEnv, err := envfile.ReadEnv(envSamplePath)
if err != nil {
return Recipe{}, err
}
@ -258,7 +258,7 @@ func Get(recipeName string, offline bool) (Recipe, error) {
func (r Recipe) SampleEnv() (map[string]string, error) {
envSamplePath := path.Join(config.RECIPES_DIR, r.Name, ".env.sample")
sampleEnv, err := app.ReadEnv(envSamplePath)
sampleEnv, err := envfile.ReadEnv(envSamplePath)
if err != nil {
return sampleEnv, fmt.Errorf("unable to discover .env.sample for %s", r.Name)
}