deploy: scripts Gitea push + SSH server deploy + nginx web + OpenClaw messages + RUNBOOK

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Floppyrj45
2026-04-19 17:55:52 +02:00
parent 6069e6117e
commit a12ec18027
6 changed files with 339 additions and 0 deletions

56
deploy/push_to_gitea.sh Normal file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
# Push DauphinCraft vers Gitea .86
set -e
GITEA_URL="${GITEA_URL:-http://192.168.1.86:3000}"
GITEA_USER="${GITEA_USER:-flagabat}"
GITEA_PASS="${GITEA_PASS:-SuperTeam2026!}"
REPO_NAME="${REPO_NAME:-dauphincraft}"
PROJECT_DIR="${PROJECT_DIR:-$(dirname "$0")/..}"
cd "$PROJECT_DIR"
# 1. Créer repo via API (idempotent)
echo "=== Création repo $REPO_NAME ==="
curl -s -u "$GITEA_USER:$GITEA_PASS" -X POST "$GITEA_URL/api/v1/user/repos" \
-H "Content-Type: application/json" \
-d "{\"name\":\"$REPO_NAME\",\"description\":\"DauphinCraft — Minecraft-like sous-marin\",\"private\":false,\"auto_init\":false}" \
| head -5 || true
# 2. Ajouter remote Gitea
GITEA_REMOTE="$GITEA_URL/$GITEA_USER/$REPO_NAME.git"
git remote remove gitea 2>/dev/null || true
git remote add gitea "http://$GITEA_USER:$GITEA_PASS@${GITEA_REMOTE#http://}"
# 3. Push
echo "=== Push master vers Gitea ==="
git push -u gitea master
# 4. Créer release v0.1.0 via API
echo "=== Création release v0.1.0 ==="
RELEASE_JSON=$(curl -s -u "$GITEA_USER:$GITEA_PASS" -X POST "$GITEA_URL/api/v1/repos/$GITEA_USER/$REPO_NAME/releases" \
-H "Content-Type: application/json" \
-d '{"tag_name":"v0.1.0","target_commitish":"master","name":"v0.1.0 — First beta","body":"## Première beta publique\n\n- Monde voxel procédural sous-marin\n- Dauphin contrôleur, écholocation\n- Inventaire + 5 recettes craft\n- Mobs: poissons, méduses, requin\n- Multijoueur ENet 16 joueurs\n- Ambiance shaders + audio CC0\n\nDownload Windows + Serveur Linux ci-dessous.","draft":false,"prerelease":true}')
echo "$RELEASE_JSON" | head -10
RELEASE_ID=$(echo "$RELEASE_JSON" | grep -oP '"id":\s*\K\d+' | head -1)
# 5. Upload artifacts
if [ -n "$RELEASE_ID" ]; then
echo "=== Upload client Windows ==="
[ -f builds/DauphinCraft.exe ] && curl -s -u "$GITEA_USER:$GITEA_PASS" -X POST \
"$GITEA_URL/api/v1/repos/$GITEA_USER/$REPO_NAME/releases/$RELEASE_ID/assets?name=DauphinCraft-v0.1-win64.exe" \
-H "Content-Type: application/octet-stream" \
--data-binary "@builds/DauphinCraft.exe" | head -3
[ -f builds/DauphinCraft.pck ] && curl -s -u "$GITEA_USER:$GITEA_PASS" -X POST \
"$GITEA_URL/api/v1/repos/$GITEA_USER/$REPO_NAME/releases/$RELEASE_ID/assets?name=DauphinCraft-v0.1.pck" \
-H "Content-Type: application/octet-stream" \
--data-binary "@builds/DauphinCraft.pck" | head -3
echo "=== Upload serveur Linux ==="
[ -f builds/DauphinCraft-Server-v0.1.tar.gz ] && curl -s -u "$GITEA_USER:$GITEA_PASS" -X POST \
"$GITEA_URL/api/v1/repos/$GITEA_USER/$REPO_NAME/releases/$RELEASE_ID/assets?name=DauphinCraft-Server-v0.1.tar.gz" \
-H "Content-Type: application/octet-stream" \
--data-binary "@builds/DauphinCraft-Server-v0.1.tar.gz" | head -3
fi
echo "=== Terminé ==="
echo "Release URL: $GITEA_URL/$GITEA_USER/$REPO_NAME/releases"