WIP heinous appEnv threading for env var loading

This commit is contained in:
2021-09-01 15:01:20 +02:00
parent 09873b42ce
commit 063fa66af9
5 changed files with 47 additions and 18 deletions

View File

@ -229,7 +229,7 @@ func GetAppStatuses(appFiles AppFiles) (map[string]string, error) {
// GetAppComposeFiles retrieves a compose specification for a recipe. This
// specification is the result of a merge of all the compose.**.yml files in
// the recipe repository.
func GetAppComposeFiles(recipe string) (*composetypes.Config, error) {
func GetAppComposeFiles(recipe string, appEnv AppEnv) (*composetypes.Config, error) {
pattern := fmt.Sprintf("%s/%s/compose**yml", APPS_DIR, recipe)
composeFiles, err := filepath.Glob(pattern)
if err != nil {
@ -237,7 +237,7 @@ func GetAppComposeFiles(recipe string) (*composetypes.Config, error) {
}
opts := options.Deploy{Composefiles: composeFiles}
compose, err := loader.LoadComposefile(opts)
compose, err := loader.LoadComposefile(opts, appEnv)
if err != nil {
return &composetypes.Config{}, err
}
@ -245,7 +245,7 @@ func GetAppComposeFiles(recipe string) (*composetypes.Config, error) {
return compose, nil
}
func UpdateAppComposeTag(recipe, image, tag string) error {
func UpdateAppComposeTag(recipe, image, tag string, appEnv AppEnv) error {
pattern := fmt.Sprintf("%s/%s/compose**yml", APPS_DIR, recipe)
composeFiles, err := filepath.Glob(pattern)
if err != nil {
@ -254,7 +254,7 @@ func UpdateAppComposeTag(recipe, image, tag string) error {
for _, composeFile := range composeFiles {
opts := options.Deploy{Composefiles: []string{composeFile}}
compose, err := loader.LoadComposefile(opts)
compose, err := loader.LoadComposefile(opts, appEnv)
if err != nil {
return err
}
@ -298,7 +298,7 @@ func UpdateAppComposeTag(recipe, image, tag string) error {
return nil
}
func UpdateAppComposeLabel(recipe, serviceName, newLabel string) error {
func UpdateAppComposeLabel(recipe, serviceName, newLabel string, appEnv AppEnv) error {
pattern := fmt.Sprintf("%s/%s/compose**yml", APPS_DIR, recipe)
composeFiles, err := filepath.Glob(pattern)
if err != nil {
@ -307,7 +307,7 @@ func UpdateAppComposeLabel(recipe, serviceName, newLabel string) error {
for _, composeFile := range composeFiles {
opts := options.Deploy{Composefiles: []string{composeFile}}
compose, err := loader.LoadComposefile(opts)
compose, err := loader.LoadComposefile(opts, appEnv)
if err != nil {
return err
}