forked from toolshed/abra
WIP heinous appEnv threading for env var loading
This commit is contained in:
@ -3,7 +3,6 @@ package stack
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
@ -16,8 +15,8 @@ import (
|
||||
)
|
||||
|
||||
// LoadComposefile parse the composefile specified in the cli and returns its Config and version.
|
||||
func LoadComposefile(opts options.Deploy) (*composetypes.Config, error) {
|
||||
configDetails, err := getConfigDetails(opts.Composefiles)
|
||||
func LoadComposefile(opts options.Deploy, appEnv map[string]string) (*composetypes.Config, error) {
|
||||
configDetails, err := getConfigDetails(opts.Composefiles, appEnv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -66,7 +65,7 @@ func propertyWarnings(properties map[string]string) string {
|
||||
return strings.Join(msgs, "\n\n")
|
||||
}
|
||||
|
||||
func getConfigDetails(composefiles []string) (composetypes.ConfigDetails, error) {
|
||||
func getConfigDetails(composefiles []string, appEnv map[string]string) (composetypes.ConfigDetails, error) {
|
||||
var details composetypes.ConfigDetails
|
||||
|
||||
absPath, err := filepath.Abs(composefiles[0])
|
||||
@ -81,7 +80,7 @@ func getConfigDetails(composefiles []string) (composetypes.ConfigDetails, error)
|
||||
}
|
||||
// Take the first file version (2 files can't have different version)
|
||||
details.Version = schema.Version(details.ConfigFiles[0].Config)
|
||||
details.Environment, err = buildEnvironment(os.Environ())
|
||||
details.Environment = appEnv
|
||||
return details, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user