forked from toolshed/abra
fix: log which compose files are being loaded
See coop-cloud/organising#167.
This commit is contained in:
parent
f87aad4688
commit
20ecdb8061
@ -304,6 +304,7 @@ func GetAppStatuses(appFiles AppFiles) (map[string]string, error) {
|
|||||||
// merged into a composetypes.Config while respecting the COMPOSE_FILE env var.
|
// merged into a composetypes.Config while respecting the COMPOSE_FILE env var.
|
||||||
func GetAppComposeFiles(recipe string, appEnv AppEnv) ([]string, error) {
|
func GetAppComposeFiles(recipe string, appEnv AppEnv) ([]string, error) {
|
||||||
if _, ok := appEnv["COMPOSE_FILE"]; !ok {
|
if _, ok := appEnv["COMPOSE_FILE"]; !ok {
|
||||||
|
logrus.Debug("no COMPOSE_FILE detected, loading all compose files")
|
||||||
pattern := fmt.Sprintf("%s/%s/compose**yml", APPS_DIR, recipe)
|
pattern := fmt.Sprintf("%s/%s/compose**yml", APPS_DIR, recipe)
|
||||||
composeFiles, err := filepath.Glob(pattern)
|
composeFiles, err := filepath.Glob(pattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -314,6 +315,8 @@ func GetAppComposeFiles(recipe string, appEnv AppEnv) ([]string, error) {
|
|||||||
|
|
||||||
var composeFiles []string
|
var composeFiles []string
|
||||||
composeFileEnvVar := appEnv["COMPOSE_FILE"]
|
composeFileEnvVar := appEnv["COMPOSE_FILE"]
|
||||||
|
envVars := strings.Split(composeFileEnvVar, ":")
|
||||||
|
logrus.Debug("COMPOSE_FILE detected ('%s'), loading '%s'", composeFileEnvVar, envVars)
|
||||||
for _, file := range strings.Split(composeFileEnvVar, ":") {
|
for _, file := range strings.Split(composeFileEnvVar, ":") {
|
||||||
path := fmt.Sprintf("%s/%s/%s", APPS_DIR, recipe, file)
|
path := fmt.Sprintf("%s/%s/%s", APPS_DIR, recipe, file)
|
||||||
composeFiles = append(composeFiles, path)
|
composeFiles = append(composeFiles, path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user