refactor(update scripts): enhance directory handling and error management
Some checks failed
Deploy to production / deploy (push) Failing after 1m46s

- Updated update-backend.sh and update-frontend.sh to accept a target directory as a parameter, improving flexibility.
- Refactored paths to use the target directory for all operations, ensuring consistency and reducing hardcoded values.
- Added error handling with 'set -euo pipefail' for better script reliability.
- Improved user feedback by displaying the target directory during updates.
This commit is contained in:
Torsten Schulz (local)
2026-03-30 13:19:11 +02:00
parent 5001292616
commit b2591da428
4 changed files with 71 additions and 37 deletions

View File

@@ -1,7 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
TARGET_DIR="${1:?Zielverzeichnis fehlt: ./update.sh <z. B. /opt/yourpart-green>}"
echo "=== YourPart Update Script ==="
echo "Ziel-Slot: $TARGET_DIR"
echo "Aktualisiert die Anwendung, ohne .env-Dateien zu überschreiben"
echo ""
@@ -35,11 +38,11 @@ fi
echo ""
echo "=== Updating Backend ==="
./update-backend.sh
./update-backend.sh "$TARGET_DIR"
echo ""
echo "=== Building and Updating Frontend ==="
./update-frontend.sh
./update-frontend.sh "$TARGET_DIR"
echo ""
echo "=== Update Completed! ==="