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:
@@ -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.
|
||||
|
||||
**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):**
|
||||
1. Lokal bauen + Smoke-Test → `git push` (origin = Gitea `http://192.168.178.153:3000/Hitonabi/mission-control.git`).
|
||||
2. Bosgame: `cd ~/mission-control && git pull --ff-only` (Source-Repo).
|
||||
3. Nach `/opt` ausrollen — **ohne sudo** (`hitonabi` besitzt `/opt/mission-control`), `.venv` ausnehmen:
|
||||
1. Frontend bauen: `cd frontend && npm run build` → `static/dist/main.js` aktualisiert.
|
||||
2. Lokal Smoke-Test → `git push` (origin = Gitea `http://192.168.178.153:3000/Hitonabi/mission-control.git`).
|
||||
3. Bosgame: `cd ~/mission-control && git pull --ff-only` (Source-Repo).
|
||||
4. Nach `/opt` ausrollen — **ohne sudo**, `node_modules` ausnehmen:
|
||||
```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. **Niemals direkt in `/opt` arbeiten.** Logs: `journalctl -u mission-control -f`.
|
||||
5. `sudo systemctl restart mission-control` (Passwort nötig). Prod = `:9000`, Dev-Spielwiese = `:9001`.
|
||||
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
|
||||
rsync; **Python-Code-Änderungen brauchen den Restart**.
|
||||
|
||||
Reference in New Issue
Block a user