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
+11 -6
View File
@@ -5,7 +5,7 @@ BASE_DIR="/opt/appfactory"
CATALOG_FILE="$BASE_DIR/apps/catalog.yml"
CADDY_FILE="$BASE_DIR/gateway/Caddyfile"
cat > "$CADDY_FILE" <<'EOF'
cat > "$CADDY_FILE" <<'EOF_CADDY'
:80 {
handle /health {
respond "AppFactory OK" 200
@@ -22,13 +22,18 @@ cat > "$CADDY_FILE" <<'EOF'
file_server
}
EOF
EOF_CADDY
awk '
/- id:/ { print " handle_path /apps/" $3 "/* {\n reverse_proxy " $3 ":8000\n }\n" }
/- id:/ {
print " handle_path /apps/" $3 "/* {"
print " reverse_proxy " $3 ":8000"
print " }"
print ""
}
' "$CATALOG_FILE" >> "$CADDY_FILE"
cat >> "$CADDY_FILE" <<'EOF'
cat >> "$CADDY_FILE" <<'EOF_CADDY'
handle_path /webhook/* {
reverse_proxy appfactory-webhook:9000
}
@@ -41,6 +46,6 @@ cat >> "$CADDY_FILE" <<'EOF'
respond "AppFactory gateway is running" 200
}
}
EOF
EOF_CADDY
docker exec appfactory-caddy caddy reload --config /etc/caddy/Caddyfile || docker restart appfactory-caddy
docker exec appfactory-caddy caddy reload --config /etc/caddy/Caddyfile