diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100644 index 0000000..1ca782e --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -euo pipefail + +REPO_DIR="/opt/pingu/repo" +TARGET_DIR="/opt/pingu/scripts" +LOG_FILE="/opt/pingu/logs/deploy.log" + +exec >> "$LOG_FILE" 2>&1 + +echo "==== $(date) Deploy gestartet auf $(hostname) ====" + +cd "$REPO_DIR" + +echo "Pull latest changes..." +git pull + +echo "Sync scripts..." +rsync -av --delete "$REPO_DIR/scripts/" "$TARGET_DIR/" + +echo "Set permissions..." +chmod +x "$TARGET_DIR"/*.sh + +echo "==== Deploy fertig ====" \ No newline at end of file