79 lines
2.6 KiB
Makefile
79 lines
2.6 KiB
Makefile
.PHONY: up down build logs migrate seed test test-api test-worker test-watcher lint check format
|
|
|
|
up: validate-env
|
|
docker compose up -d
|
|
|
|
validate-env:
|
|
bash scripts/validate-env.sh
|
|
|
|
down:
|
|
docker compose down
|
|
|
|
build: check
|
|
docker compose build
|
|
|
|
logs:
|
|
docker compose logs -f
|
|
|
|
# ── Database ──────────────────────────────────────────────────────────────────
|
|
|
|
migrate:
|
|
docker compose exec api alembic upgrade head
|
|
|
|
migrate-auto:
|
|
docker compose exec api alembic revision --autogenerate -m "$(m)"
|
|
|
|
# ── Setup ─────────────────────────────────────────────────────────────────────
|
|
|
|
setup: validate-env up
|
|
@echo "Waiting for Nextcloud to initialize (this can take ~60s)..."
|
|
@sleep 60
|
|
bash scripts/nc-setup.sh
|
|
bash scripts/seed.sh
|
|
|
|
# ── Testing ───────────────────────────────────────────────────────────────────
|
|
|
|
test: test-api test-worker test-watcher
|
|
|
|
test-api:
|
|
cd api && uv run pytest tests/ -v --cov=src/rehearsalhub --cov-report=term-missing
|
|
|
|
test-worker:
|
|
cd worker && uv run pytest tests/ -v --cov=src/worker --cov-report=term-missing
|
|
|
|
test-watcher:
|
|
cd watcher && uv run pytest tests/ -v --cov=src/watcher --cov-report=term-missing
|
|
|
|
test-integration:
|
|
cd api && uv run pytest tests/integration/ -v -m integration
|
|
|
|
# ── Linting & type checking ───────────────────────────────────────────────────
|
|
|
|
# check: run all linters + type checkers locally (fast, no Docker)
|
|
check: lint typecheck-web
|
|
|
|
lint:
|
|
cd api && uv run ruff check src/ tests/ && uv run mypy src/
|
|
cd worker && uv run ruff check src/ tests/
|
|
cd watcher && uv run ruff check src/ tests/
|
|
cd web && npm run lint
|
|
|
|
typecheck-web:
|
|
cd web && npm run typecheck
|
|
|
|
format:
|
|
cd api && uv run ruff format src/ tests/
|
|
cd worker && uv run ruff format src/ tests/
|
|
cd watcher && uv run ruff format src/ tests/
|
|
|
|
# ── Dev helpers ───────────────────────────────────────────────────────────────
|
|
|
|
shell-api:
|
|
docker compose exec api bash
|
|
|
|
shell-db:
|
|
docker compose exec db psql -U $${POSTGRES_USER} -d $${POSTGRES_DB}
|
|
|
|
shell-redis:
|
|
docker compose exec redis redis-cli
|