From adfa7d17e9b4f8d629597f7f110da3d1e56546ff Mon Sep 17 00:00:00 2001 From: AI Agent Date: Fri, 2 Oct 2026 01:41:51 +0200 Subject: [PATCH] deploy.sh: kein Token mehr noetig, Repo ist oeffentlich Zugangsschluessel-Block entfernt, Remote zeigt auf den neuen Eigentuemer. --- deploy.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..426042a --- /dev/null +++ b/deploy.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Deploy Trainingsplan: aktuellen Stand aus dem Gitea-Repo holen und neu bauen. +# Das Repo ist oeffentlich, es wird kein Zugangsschluessel gebraucht. +# +# Aufruf im CasaOS-Terminal: +# bash /DATA/AppData/trainingsplan/deploy.sh + +set -euo pipefail + +APP_DIR="/DATA/AppData/trainingsplan" +ORIGIN="https://git.somantis.net/J4stMarkus/trainingsplan.git" + +cd "$APP_DIR" || { echo "FEHLER: $APP_DIR existiert nicht." >&2; exit 1; } + +if [ -d .git ]; then + git remote set-url origin "$ORIGIN" 2>/dev/null \ + || git remote add origin "$ORIGIN" +else + git init -q + git remote add origin "$ORIGIN" +fi + +echo "==> Pull main von Gitea" +git fetch -q origin main +git reset --hard -q origin/main + +echo "==> Docker build (--no-cache) + up" +docker compose build --no-cache +docker compose up -d + +# ---------- Kurzer Healthcheck ---------- +sleep 2 +if curl -s -o /dev/null -w "%{http_code}" "http://127.0.0.1:8080/api/data" | grep -q 200; then + echo "OK: Trainingsplan laeuft auf http://:8080/" +else + echo "WARNUNG: Container gestartet, aber /api/data antwortet noch nicht." + echo " Pruefe: docker compose ps / docker compose logs" +fi