Use catalog as source of truth for app deployment

This commit is contained in:
2026-05-21 11:55:16 +02:00
parent 7cb50fc496
commit ec18df3f24
3 changed files with 53 additions and 74 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
BASE_DIR="/opt/appfactory"
CATALOG_FILE="$BASE_DIR/apps/catalog.yml"
COMPOSE_FILE="$BASE_DIR/deploy/apps-compose.yml"
cat > "$COMPOSE_FILE" <<'EOF_COMPOSE'
services:
EOF_COMPOSE
awk '
/- id:/ { app=$3 }
/language:/ { lang=$2 }
/status:/ {
if (app != "") {
print " " app ":"
print " image: " app ":latest"
print " container_name: " app
print " restart: unless-stopped"
print " environment:"
print " - APP_NAME=" app
print " - ROOT_PATH=/apps/" app
print " networks:"
print " - appfactory"
print ""
}
}
' "$CATALOG_FILE" >> "$COMPOSE_FILE"