31 lines
720 B
Bash
Executable File
31 lines
720 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
CONFIG_FILE="/opt/appfactory/config/appfactory.env"
|
|
source "$CONFIG_FILE"
|
|
|
|
CATALOG_FILE="$APPFACTORY_DIR/apps/catalog.yml"
|
|
COMPOSE_FILE="$APPFACTORY_DIR/deploy/apps-compose.yml"
|
|
|
|
cat > "$COMPOSE_FILE" <<'EOF_COMPOSE'
|
|
services:
|
|
EOF_COMPOSE
|
|
|
|
awk '
|
|
/- id:/ { app=$3 }
|
|
/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"
|