This commit is contained in:
2025-10-06 09:31:30 -04:00
parent 2a2cd90013
commit 5e62020e35
+24 -36
View File
@@ -53,48 +53,36 @@ jobs:
- name: Generate combined service list - name: Generate combined service list
run: | run: |
# Load .env variables safely set -euo pipefail
if [ -f ".env" ]; then
set -o allexport
source .env
set +o allexport
fi
COMPOSE_FILES=$(find . -type f -name "docker-compose*.yml" \ echo "[]" > combined_services.json
-a ! -name "*windows*" \
-a ! -name "*gui*" \
-a ! -name "*macos*" \
-a ! -name "*hivemind*" \
-a ! -name "*server*" \
| sort)
if [ -z "$COMPOSE_FILES" ]; then
echo "No docker-compose files found. Exiting."
exit 0
fi
echo "Processing combined Compose files:" echo "Processing combined Compose files:"
echo "$COMPOSE_FILES" for f in ${{ steps.find-compose-files.outputs.compose_files }}; do
echo " - $f"
done
yq -o=json eval-all ' echo "Generating merged docker-compose config..."
explode(.) | docker compose \
.services | to_entries | $(for f in ${{ steps.find-compose-files.outputs.compose_files }}; do echo "-f $f"; done) \
map({ --env-file .env \
"service": .key, config > combined.yml
"image": (.value.image // "" |
sub("\\$\\{VERSION\\}", env(VERSION) // "") |
sub("\\$\\{PULL_POLICY\\}", env(PULL_POLICY) // "") |
sub("\\$\\{.*?\\}", ""))
})
' $COMPOSE_FILES \
| jq -s add | jq 'unique_by(.service)' > services.json
if [ ! -s services.json ]; then echo "Extracting services and images..."
echo "No services extracted. Exiting." yq -o=json '
exit 1 .services
fi | to_entries
| map({
service: .key,
image: (.value.image // "null")
})
' combined.yml > combined_services.json
echo "✅ Generated services.json with all services and images." echo "Deduplicating services..."
jq 'unique_by(.service)' combined_services.json > services.json
echo "Final services.json:"
cat services.json
- name: Generate Markdown Table - name: Generate Markdown Table
uses: gazab/create-markdown-table@6686233d7008e8d8b9d4bbdbfd1fb1ae510019f0 # v1.0.7 uses: gazab/create-markdown-table@6686233d7008e8d8b9d4bbdbfd1fb1ae510019f0 # v1.0.7