From bf26d6fa74d6ba20dabc79ed359d7821777a8e9d Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 7 Dec 2023 13:41:18 +0100 Subject: [PATCH] refactor(docker-compose): don't reset the file while running Signed-off-by: rjshrjndrn --- scripts/docker-compose/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docker-compose/run.sh b/scripts/docker-compose/run.sh index e479b4080..2772e766b 100644 --- a/scripts/docker-compose/run.sh +++ b/scripts/docker-compose/run.sh @@ -1,9 +1,9 @@ # Load variables from common.env into the current shell's environment -set -a # automatically export all variables +set -a # automatically export all variables source common.env set +a # Use the `envsubst` command to substitute the shell environment variables into reference_var.env and output to a combined .env -find ./ -type f \( -iname "*.env" -o -iname "docker-compose.yaml" \) ! -name "common.env" -exec /bin/bash -c 'file="{}"; git checkout -- "$file"; cp "$file" "$file.bak"; envsubst < "$file.bak" > "$file"; rm "$file.bak"' \; +find ./ -type f \( -iname "*.env" -o -iname "docker-compose.yaml" \) ! -name "common.env" -exec /bin/bash -c 'file="{}";cp "$file" "$file.bak"; envsubst < "$file.bak" > "$file"; rm "$file.bak"' \; sudo -E docker-compose up -d