From 867adcf83a110ce227c14aa0029b6c85933f8597 Mon Sep 17 00:00:00 2001 From: AhmedGrati Date: Sun, 5 Nov 2023 15:06:15 +0100 Subject: [PATCH] docs: add COMPOSE_FILE env variable to user-guide.md Signed-off-by: AhmedGrati --- docs/user-guide.md | 5 +++++ script/test/cmd/tests_new.sh | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/user-guide.md b/docs/user-guide.md index a842062c..e974b978 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -66,6 +66,11 @@ redis-master-deployment.yaml When multiple docker-compose files are provided the configuration is merged. Any configuration that is common will be over ridden by subsequent file. +You can provide your docker-compose files via environment variables as following: +```sh +$ COMPOSE_FILE="docker-compose.yaml alternative-docker-compose.yaml" kompose convert +``` + ### OpenShift ```sh diff --git a/script/test/cmd/tests_new.sh b/script/test/cmd/tests_new.sh index 56111310..1f4cc540 100755 --- a/script/test/cmd/tests_new.sh +++ b/script/test/cmd/tests_new.sh @@ -311,6 +311,7 @@ cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/no-profile-warning/docker-com convert::expect_warning "$cmd" "No service selected. The profile specified in services of your compose yaml may not exist." || exit 1 # Test COMPOSE_FILE env variable is honored -k8s_cmd="COMPOSE_FILE=\"$KOMPOSE_ROOT/script/test/fixtures/compose-file-env-variable/docker-compose.yaml $KOMPOSE_ROOT/script/test/fixtures/compose-file-env-variable/alternative-docker-compose.yaml\" kompose convert --stdout --with-kompose-annotation=false" -k8s_output="$KOMPOSE_ROOT/script/test/fixtures/fixtures/compose-file-env-variable/output-k8s.yaml" +export COMPOSE_FILE="$KOMPOSE_ROOT/script/test/fixtures/compose-file-env-variable/docker-compose.yaml $KOMPOSE_ROOT/script/test/fixtures/compose-file-env-variable/alternative-docker-compose.yaml" +k8s_cmd="kompose convert --stdout --with-kompose-annotation=false" +k8s_output="$KOMPOSE_ROOT/script/test/fixtures/compose-file-env-variable/output-k8s.yaml" convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1