Add deployment workflow (docker-compose, deploy.sh, webhook receiver)

This commit is contained in:
2026-06-10 11:17:08 +02:00
parent 84c933ea9c
commit b9fc741505
5 changed files with 129 additions and 11 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -e
REPO_DIR="/opt/aufmassweb"
COMPOSE_FILE="docker-compose.deploy.yml"
LOG_FILE="/var/log/aufmassweb-deploy.log"
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" | tee -a "$LOG_FILE"
}
log "=== Deployment gestartet ==="
cd "$REPO_DIR"
log "Pull von Gitea..."
git pull origin main 2>&1 | tee -a "$LOG_FILE"
log "Docker Compose build..."
docker compose -f "$COMPOSE_FILE" build 2>&1 | tee -a "$LOG_FILE"
log "Docker Compose up (Rolling-Restart)..."
docker compose -f "$COMPOSE_FILE" up -d --remove-orphans 2>&1 | tee -a "$LOG_FILE"
log "Alte Images bereinigen..."
docker image prune -f 2>&1 | tee -a "$LOG_FILE"
log "=== Deployment erfolgreich abgeschlossen ==="