This commit is contained in:
team3
2026-09-19 20:59:47 +02:00
parent 45a6ecf654
commit 4548178a7c
20 changed files with 832 additions and 23 deletions

View File

@@ -1,11 +1,13 @@
# make install – Extension installieren, falls noch nicht vorhanden, und aktivieren
# make update – installierte Extension mit dem Stand aus diesem Ordner überschreiben
# Extension: make install | make update
# Server: make dev (lokal, Port $(PORT)) | make prod (auf dem Server) | make stop | make logs | make down | make test
UUID = desktop@marha.de
SRC = $(CURDIR)/$(UUID)
DEST = $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
VENV = backend/.venv
PORT ?= 8040
.ONESHELL:
.PHONY: install update enable
.PHONY: install update enable venv dev prod stop logs down test
install:
@if [ -e "$(DEST)" ]; then
@@ -35,3 +37,37 @@ update:
# UUID in die aktiven Extensions eintragen, falls sie fehlt
enable:
@python3 dev/enable.py "$(UUID)"
# ── Server ───────────────────────────────────────────────────────────────────
venv: $(VENV)/bin/uvicorn
$(VENV)/bin/uvicorn: backend/requirements.txt
python3 -m venv $(VENV)
$(VENV)/bin/pip install -q -r backend/requirements.txt
# Lokal entwickeln. Token kommt aus .env (Vorlage: .env.example).
dev: venv
@[ -f .env ] || { echo ".env fehlt. Vorlage: cp .env.example .env, dann SYNC_TOKEN setzen."; exit 1; }
set -a; . ./.env; set +a
echo "Server: http://localhost:$(PORT)"
cd backend && .venv/bin/uvicorn app.main:app --reload --port $(PORT)
# Produktion (auf dem Server ausführen, im Projektverzeichnis)
prod:
@[ -f .env ] || { echo ".env fehlt. Vorlage: cp .env.example .env, dann SYNC_TOKEN setzen."; exit 1; }
docker compose up -d --build
echo "läuft: https://planer.marha.de"
# [u] statt u: so trifft das Muster nicht die eigene Shell, die es im Aufruf trägt
stop:
-pkill -f "$(CURDIR)/$(VENV)/bin/python3 .venv/bin/[u]vicorn" 2>/dev/null
echo "gestoppt."
logs:
docker compose logs -f
down:
docker compose down
test: venv
cd backend && .venv/bin/python -m pytest -q