add deploy script
This commit is contained in:
@@ -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 ===="
|
||||
Reference in New Issue
Block a user