- Cameras API: CRUD with service/controller/DTOs + Blazor page - Docker: production-grade compose with healthchecks, .env, Makefile, networks - Healthchecks: /healthz (liveness) and /readyz (readiness) endpoints - Testing: 13 integration tests (Auth, Sites, Users, Cameras controllers) - Users: create, list, lock, reset-password - Cameras: create with site, list by site - Environment: .env.example, docker-compose.override.yml for dev - Infrastructure: ICameraService registered in DI
67 lines
2.8 KiB
Makefile
67 lines
2.8 KiB
Makefile
# ─── Heimdall — Development & Deployment ──────────────────────────
|
|
.DEFAULT_GOAL := help
|
|
.PHONY: help build test docker-up docker-down docker-build clean dev
|
|
|
|
help: ## Show this help
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
|
|
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
|
|
|
build: ## Build the .NET solution
|
|
dotnet build
|
|
|
|
test: ## Run all tests
|
|
dotnet test
|
|
|
|
test-watch: ## Run tests in watch mode
|
|
dotnet watch test --project tests/Heimdall.Domain.Tests
|
|
|
|
clean: ## Clean build artifacts
|
|
dotnet clean && rm -rf src/**/bin src/**/obj tests/**/bin tests/**/obj
|
|
|
|
# ─── Docker ──────────────────────────────────────────────────────
|
|
|
|
docker-up: ## Start all services (dev)
|
|
docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml up -d
|
|
|
|
docker-down: ## Stop all services
|
|
docker compose -f docker/docker-compose.yml down -v
|
|
|
|
docker-build: ## Rebuild images without cache
|
|
docker compose -f docker/docker-compose.yml build --no-cache
|
|
|
|
docker-logs: ## Tail logs
|
|
docker compose -f docker/docker-compose.yml logs -f
|
|
|
|
docker-ps: ## List running services
|
|
docker compose -f docker/docker-compose.yml ps
|
|
|
|
docker-reset: ## Stop and remove everything
|
|
docker compose -f docker/docker-compose.yml down -v --rmi all
|
|
|
|
# ─── Deployment ──────────────────────────────────────────────────
|
|
|
|
deploy: docker-build docker-up ## Build and deploy
|
|
|
|
# ─── Database ────────────────────────────────────────────────────
|
|
|
|
migration-add: ## Add a new EF migration (usage: make migration-add NAME=xxx)
|
|
dotnet ef migrations add $(NAME) -p src/Heimdall.Infrastructure
|
|
|
|
migration-remove: ## Remove last migration
|
|
dotnet ef migrations remove -p src/Heimdall.Infrastructure
|
|
|
|
# ─── Dev helpers ─────────────────────────────────────────────────
|
|
|
|
dev-api: ## Run API in development mode
|
|
DATABASE_URL="Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall" \
|
|
JWT__Key="ThisIsADevKeyThatIsAtLeast32BytesLong!!" \
|
|
ASPNETCORE_ENVIRONMENT=Development \
|
|
dotnet run --project src/Heimdall.Api
|
|
|
|
dev-worker: ## Run workers in development mode
|
|
DATABASE_URL="Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall" \
|
|
dotnet run --project src/Heimdall.Workers
|
|
|
|
dev-web: ## Run Web UI in development mode
|
|
dotnet run --project src/Heimdall.Web
|