docs/fix: Deploy-Kette fuer Svelte-Build dokumentiert + node_modules excludiert

- CLAUDE.md: npm run build als Schritt vor git push dokumentiert, Vite-Dev-Hinweis
- maintenance.py self-update: frontend/node_modules vom rsync ausgenommen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-06-22 21:50:49 +02:00
parent e2fc1d24cf
commit 27b229b3d7
2 changed files with 18 additions and 6 deletions
+17 -6
View File
@@ -54,15 +54,26 @@ User ist **`hitonabi`** (klein!). `sudo` braucht generell ein Passwort — **au
**Self-Update statt manuellem Deploy:** Der Button „Mission Control aktualisieren" (`POST /api/self-update`) macht `git pull` (Source) → rsync → `systemctl restart` — der dokumentierte manuelle Weg unten ist nur noch Fallback/Erstinstallation. **Self-Update statt manuellem Deploy:** Der Button „Mission Control aktualisieren" (`POST /api/self-update`) macht `git pull` (Source) → rsync → `systemctl restart` — der dokumentierte manuelle Weg unten ist nur noch Fallback/Erstinstallation.
**Frontend-Build (Vite + Svelte 5, ab Phase C):**
```bash
cd frontend && npm install # einmalig
npm run build # vor jedem git push — Output: static/dist/main.js
```
Das Build-Ergebnis (`static/dist/`) wird committet → kein Build-Schritt auf dem Server.
Beim Entwickeln: `npm run dev` in `frontend/` startet den Vite Dev-Server (Port 5173) für HMR.
Neue Svelte-Panels kommen in `frontend/src/panels/`. Sobald ein Panel migriert ist,
wird es in `frontend/src/main.ts` importiert und das alte `static/js/panels/<panel>.js` nicht mehr gebraucht.
**Deploy-Kette (Windows → Gitea → Bosgame):** **Deploy-Kette (Windows → Gitea → Bosgame):**
1. Lokal bauen + Smoke-Test → `git push` (origin = Gitea `http://192.168.178.153:3000/Hitonabi/mission-control.git`). 1. Frontend bauen: `cd frontend && npm run build``static/dist/main.js` aktualisiert.
2. Bosgame: `cd ~/mission-control && git pull --ff-only` (Source-Repo). 2. Lokal Smoke-Test → `git push` (origin = Gitea `http://192.168.178.153:3000/Hitonabi/mission-control.git`).
3. Nach `/opt` ausrollen — **ohne sudo** (`hitonabi` besitzt `/opt/mission-control`), `.venv` ausnehmen: 3. Bosgame: `cd ~/mission-control && git pull --ff-only` (Source-Repo).
4. Nach `/opt` ausrollen — **ohne sudo**, `node_modules` ausnehmen:
```bash ```bash
rsync -a --exclude='.git' --exclude='.venv' --exclude='__pycache__' --exclude='*.pyc' ~/mission-control/ /opt/mission-control/ rsync -a --exclude='.git' --exclude='.venv' --exclude='__pycache__' --exclude='*.pyc' --exclude='frontend/node_modules' ~/mission-control/ /opt/mission-control/
``` ```
4. `sudo systemctl restart mission-control` (Passwort nötig). Prod = `:9000`, Dev-Spielwiese = `:9001`. 5. `sudo systemctl restart mission-control` (Passwort nötig). Prod = `:9000`, Dev-Spielwiese = `:9001`.
5. **Niemals direkt in `/opt` arbeiten.** Logs: `journalctl -u mission-control -f`. 6. **Niemals direkt in `/opt` arbeiten.** Logs: `journalctl -u mission-control -f`.
Statische Dateien werden je Request frisch von Platte gelesen → UI-Änderungen wirken schon nach Statische Dateien werden je Request frisch von Platte gelesen → UI-Änderungen wirken schon nach
rsync; **Python-Code-Änderungen brauchen den Restart**. rsync; **Python-Code-Änderungen brauchen den Restart**.
+1
View File
@@ -38,6 +38,7 @@ def self_update():
cmd = ( cmd = (
f"cd {shlex.quote(SOURCE_DIR)} && git pull --ff-only && " f"cd {shlex.quote(SOURCE_DIR)} && git pull --ff-only && "
f"rsync -a --exclude=.git --exclude=.venv --exclude=__pycache__ --exclude='*.pyc' " f"rsync -a --exclude=.git --exclude=.venv --exclude=__pycache__ --exclude='*.pyc' "
f"--exclude='frontend/node_modules' "
f"{shlex.quote(SOURCE_DIR)}/ {shlex.quote(PROD_DIR)}/ && " f"{shlex.quote(SOURCE_DIR)}/ {shlex.quote(PROD_DIR)}/ && "
f"sudo systemctl restart mission-control" f"sudo systemctl restart mission-control"
) )