refactor(update scripts): enhance directory handling and error management
Some checks failed
Deploy to production / deploy (push) Failing after 1m46s
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:
@@ -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! ==="
|
||||
|
||||
Reference in New Issue
Block a user