...
This commit is contained in:
@@ -53,7 +53,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate combined service list
|
- name: Generate combined service list
|
||||||
run: |
|
run: |
|
||||||
# Load environment variables from .env
|
# Load .env variables safely
|
||||||
if [ -f ".env" ]; then
|
if [ -f ".env" ]; then
|
||||||
set -o allexport
|
set -o allexport
|
||||||
source .env
|
source .env
|
||||||
@@ -76,13 +76,16 @@ jobs:
|
|||||||
echo "Processing combined Compose files:"
|
echo "Processing combined Compose files:"
|
||||||
echo "$COMPOSE_FILES"
|
echo "$COMPOSE_FILES"
|
||||||
|
|
||||||
# Replace env variables in compose files before merging
|
|
||||||
yq -o=json eval-all '
|
yq -o=json eval-all '
|
||||||
explode(.) |
|
explode(.) |
|
||||||
.services |= with_entries(
|
.services | to_entries |
|
||||||
.value.image |= sub("\\$\\{VERSION\\}", env(VERSION) // "")
|
map({
|
||||||
) |
|
"service": .key,
|
||||||
.services | to_entries | map({"service": .key, "image": .value.image})
|
"image": (.value.image // "" |
|
||||||
|
sub("\\$\\{VERSION\\}", env(VERSION) // "") |
|
||||||
|
sub("\\$\\{PULL_POLICY\\}", env(PULL_POLICY) // "") |
|
||||||
|
sub("\\$\\{.*?\\}", ""))
|
||||||
|
})
|
||||||
' $COMPOSE_FILES \
|
' $COMPOSE_FILES \
|
||||||
| jq -s add | jq 'unique_by(.service)' > services.json
|
| jq -s add | jq 'unique_by(.service)' > services.json
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user