#!/usr/bin/env bash # Deploy-Skript: Staustufen-Vorbereitung + Logistik-Musik + Heli-End-Screen + Lehrplan-Anker # Ausführen aus: /c/xampp/htdocs/geograsim/ # Voraussetzung: SSH-Key 'openclaw' im Agent geladen (passphrase einmal eingegeben) # # Nutzung: # eval $(ssh-agent) # ssh-add ~/.ssh/openclaw # Passphrase eingeben # bash App/Don_t_Deploy/deploy-2026-04-26.sh set -e SSH="ssh -i ~/.ssh/openclaw -o StrictHostKeyChecking=accept-new root@85.215.155.82" DEST="/root/webstack/projects/geograsim" SQL="App/Don_t_Deploy/migrate-2026-04-26-staustufen.sql" echo "=== 1) Code-Sync (rsync, nur Änderungen, KEIN --delete für Sicherheit) ===" rsync -avz \ --exclude='node_modules' \ --exclude='src' \ --exclude='tests' \ --exclude='Don_t_Deploy' \ --exclude='.env.local' \ --exclude='package*.json' \ --exclude='vite.config*' \ --exclude='tsconfig*' \ --exclude='*.log' \ -e "ssh -i ~/.ssh/openclaw -o StrictHostKeyChecking=accept-new" \ App/ root@85.215.155.82:$DEST/App/ echo "=== 2) Migration-SQL hochladen ===" scp -i ~/.ssh/openclaw "$SQL" root@85.215.155.82:/tmp/migrate.sql echo "=== 3) DB-Migration in Container ===" $SSH "docker cp /tmp/migrate.sql webstack-mysql:/tmp/migrate.sql && \ docker exec webstack-mysql sh -c 'mysql -uroot -pServerMySQL2026! geograsim < /tmp/migrate.sql' && \ rm /tmp/migrate.sql" echo "=== 4) Smoke-Test ===" $SSH "docker exec webstack-mysql mysql -uroot -pServerMySQL2026! geograsim -e \ 'SELECT COUNT(*) AS anker FROM lehrplan_anchors WHERE kompetenz_id IN (SELECT id FROM kompetenzen WHERE key_slug=\"raeumliche-orientierung-europa\"); \ SELECT module_id, title, status FROM module_info WHERE module_id IN (\"staustufen\",\"logistik\",\"klima-3d\");'" curl -s -o /dev/null -w "modul-logistik: HTTP %{http_code}\n" "https://geograsim.at/modul-logistik" curl -s -o /dev/null -w "modul-staustufen: HTTP %{http_code}\n" "https://geograsim.at/modul-staustufen" curl -s "https://geograsim.at/modul-logistik" | grep -oE "md-anchor-title|md-kompetenz-title" | sort | uniq -c echo "=== 5) Fertig ==="