From 9ae73363fe59b49395cfdaf1261e9dda382c260e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 26 Aug 2026 08:16:45 +0000 Subject: [PATCH] Fix app deploy failure handling and compose environment --- scripts/deploy-app.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/deploy-app.sh b/scripts/deploy-app.sh index c8440eb..0687215 100755 --- a/scripts/deploy-app.sh +++ b/scripts/deploy-app.sh @@ -2,7 +2,10 @@ set -euo pipefail CONFIG_FILE="/opt/appfactory/config/appfactory.env" + +set -a source "$CONFIG_FILE" +set +a APP_ID="${1:-}" @@ -171,6 +174,8 @@ run_step() { set +e run_step "Updating source code" bash -c " +set -e + cd '$APP_SOURCE_DIR' if [ -d '.git' ]; then @@ -183,6 +188,8 @@ RESULT=$? if [ "$RESULT" -eq 0 ]; then run_step "Generating app environment file" bash -c " +set -e + mkdir -p '$APP_DATA_DIR' python3 - '$DB_FILE' '$APP_ID' '$APP_ENV_FILE' <<'PY' @@ -259,6 +266,8 @@ fi if [ "$RESULT" -eq 0 ]; then run_step "Regenerating generated files" bash -c " +set -e + '$TOOLS_DIR/scripts/generate-catalog.sh' '$TOOLS_DIR/scripts/generate-apps-compose.sh' '$TOOLS_DIR/scripts/generate-caddyfile.sh' @@ -270,9 +279,12 @@ fi if [ "$RESULT" -eq 0 ]; then run_step "Starting app container" bash -c " +set -e + cd '$APPFACTORY_DIR/deploy' docker compose \ + --env-file '$CONFIG_FILE' \ -f docker-compose.yml \ -f apps-compose.yml \ up -d --force-recreate '$APP_ID'