feat: Workflow deploy und sicherer Deploy-Zugang für den Gitea-Runner, noch nicht eingerichtet (#1253, #1254, #1255)
All checks were successful
ci / pruefen (push) Successful in 3m11s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg7bzeoxrPsLnJ4nor4
This commit is contained in:
2026-11-30 09:33:45 +01:00
parent 7cc3844dc3
commit a3505a9f2f
7 changed files with 189 additions and 1 deletions

View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Installiert ein vom Gitea-Runner gebautes Release auf srv04 (→ #1253). Läuft als root (per sudo aus nexus-deploy).
# srv04 lädt das Binary selbst aus dem Gitea-Release, prüft die SHA-256-Prüfsumme und ruft den mitinstallierten
# install.sh auf (Sicherung der Datenbank, Umschalten, Neustart, Warten auf Bereitschaft). Der Runner schickt nur die
# Versionsnummer, nie Dateien. Die Prüfsumme stammt vom selben Server wie das Binary: sie schützt vor beschädigten
# Downloads, nicht vor einem manipulierten Gitea.
set -euo pipefail
[ "$(id -u)" -eq 0 ] || { echo "Nur als root." >&2; exit 1; }
v="${1:-}"
[[ "$v" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(-rc[0-9]{1,3})?$ ]] || { echo "Ungültige Version." >&2; exit 2; }
GITEA="https://git.wlkns.org/wlkns-dev/nexus"
datei="nexus-$v-linux-x86_64-musl"
dir="/var/lib/nexus-deploy/$v"
rm -rf "$dir"
install -d -m 0755 /var/lib/nexus-deploy "$dir"
logger -t nexus-deploy "lade $v aus dem Gitea-Release"
curl -fsSL --connect-timeout 20 --max-time 300 -o "$dir/$datei" "$GITEA/releases/download/v$v/$datei"
curl -fsSL --connect-timeout 20 --max-time 60 -o "$dir/$datei.sha256" "$GITEA/releases/download/v$v/$datei.sha256"
(cd "$dir" && sha256sum -c "$datei.sha256")
install -m 0755 "$dir/$datei" "$dir/nexus"
install -m 0755 /usr/local/lib/nexus-deploy/install.sh "$dir/install.sh"
logger -t nexus-deploy "installiere $v"
VERSION="$v" bash "$dir/install.sh" --start
logger -t nexus-deploy "$v installiert"