feat(deploy): enhance deployment scripts with skip options for backend and frontend
All checks were successful
Deploy to production / deploy (push) Successful in 1m31s

- Updated `deploy-yourpart-bluegreen.sh` to pass additional arguments for skipping backend or frontend updates.
- Enhanced `update.sh` to handle `--skip-backend` and `--skip-frontend` flags, allowing for more flexible deployment based on changes detected.
- Modified deployment workflow to conditionally execute based on changes in frontend or backend files, improving deployment efficiency.
This commit is contained in:
Torsten Schulz (local)
2026-04-17 11:33:02 +02:00
parent 2461e98fb0
commit 1f10e7c519
8 changed files with 887 additions and 168 deletions

View File

@@ -2,10 +2,33 @@
set -euo pipefail
TARGET_DIR="${1:?Zielverzeichnis fehlt: ./update.sh <z. B. /opt/yourpart-green>}"
shift || true
SKIP_BACKEND="0"
SKIP_FRONTEND="0"
while [[ $# -gt 0 ]]; do
case "$1" in
--skip-backend)
SKIP_BACKEND="1"
;;
--skip-frontend)
SKIP_FRONTEND="1"
;;
*)
echo "Unbekannte Option: $1" >&2
echo "Verwendung: ./update.sh <target-dir> [--skip-backend] [--skip-frontend]" >&2
exit 1
;;
esac
shift
done
echo "=== YourPart Update Script ==="
echo "Ziel-Slot: $TARGET_DIR"
echo "Aktualisiert die Anwendung, ohne .env-Dateien zu überschreiben"
echo "Skip Backend: $SKIP_BACKEND"
echo "Skip Frontend: $SKIP_FRONTEND"
echo ""
# Prüfen ob wir im richtigen Verzeichnis sind
@@ -36,13 +59,23 @@ if ! command -v sudo >/dev/null 2>&1; then
exit 1
fi
echo ""
echo "=== Updating Backend ==="
./update-backend.sh "$TARGET_DIR"
if [[ "$SKIP_BACKEND" == "1" ]]; then
echo ""
echo "=== Backend-Update übersprungen (--skip-backend) ==="
else
echo ""
echo "=== Updating Backend ==="
./update-backend.sh "$TARGET_DIR"
fi
echo ""
echo "=== Building and Updating Frontend ==="
./update-frontend.sh "$TARGET_DIR"
if [[ "$SKIP_FRONTEND" == "1" ]]; then
echo ""
echo "=== Frontend-Build/Update übersprungen (--skip-frontend) ==="
else
echo ""
echo "=== Building and Updating Frontend ==="
./update-frontend.sh "$TARGET_DIR"
fi
echo ""
echo "Link backend .env"