forked from toolshed/abra
WIP heinous appEnv threading for env var loading
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user