docs: add COMPOSE_FILE env variable to user-guide.md

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
This commit is contained in:
AhmedGrati 2023-11-05 15:06:15 +01:00
parent a91b57ef2e
commit 867adcf83a
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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