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.
25 lines
767 B
Bash
Executable File
25 lines
767 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Blue-Green: Deploy in einen Slot (TARGET), ohne /opt/yourpart als echtes Verzeichnis anzulegen.
|
|
# Live-Umschaltung: ln -sfn <slot> /opt/yourpart
|
|
#
|
|
# Aufruf (auf dem Server, im Repo-Root nach git pull):
|
|
# ./deploy-yourpart-bluegreen.sh /opt/yourpart-green
|
|
#
|
|
# Voraussetzung: /opt/yourpart ist ein Symlink auf den aktiven Slot.
|
|
|
|
set -euo pipefail
|
|
|
|
CURRENT_LINK="${CURRENT_LINK:-/opt/yourpart}"
|
|
TARGET="${1:?Ziel-Slot-Verzeichnis fehlt (z. B. /opt/yourpart-green)}"
|
|
shift || true
|
|
|
|
if [ ! -L "$CURRENT_LINK" ]; then
|
|
echo "❌ ERROR: $CURRENT_LINK ist kein Symlink! (Blue-Green erfordert Symlink auf den aktiven Slot.)" >&2
|
|
exit 1
|
|
fi
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
exec ./update.sh "$TARGET" "$@"
|