-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (36 loc) · 1.97 KB
/
Copy pathMakefile
File metadata and controls
53 lines (36 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Community Pro API — dev workflow
# `make dev` = infra in Docker, API via dotnet watch (fast inner loop)
# `make up` = everything in Docker (closest to prod)
API_PROJECT := src/CommunityPro.Api
COMPOSE := docker compose
.DEFAULT_GOAL := help
.PHONY: help infra up down nuke logs ps dev build test migrate migration
help: ## List available targets
@grep -hE '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
infra: ## Start Postgres + Meilisearch only
$(COMPOSE) up -d postgres meilisearch
up: ## Build and run the full stack (API + infra) in Docker
$(COMPOSE) --profile app up -d --build
down: ## Stop all containers (volumes preserved)
$(COMPOSE) --profile app down
nuke: ## Stop everything and delete volumes (destroys local data)
$(COMPOSE) --profile app down -v
logs: ## Tail API container logs
$(COMPOSE) logs -f api
ps: ## Show container status
$(COMPOSE) --profile app ps
dev: infra ## Infra in Docker, API locally with hot reload (http://localhost:5080)
dotnet watch --project $(API_PROJECT)
build: ## Build the solution
dotnet build
test: ## Run the test suite
dotnet test
migrate: infra ## Apply pending EF migrations for every module context
dotnet ef database update --project src/Modules/CommunityPro.Members --startup-project $(API_PROJECT) --context MembersDbContext
dotnet ef database update --project src/Modules/CommunityPro.Identity --startup-project $(API_PROJECT) --context IdentityDbContext
migration: ## Add a migration: make migration mod=Members name=AddSomething
dotnet ef migrations add $(name) --project src/Modules/CommunityPro.$(mod) --startup-project $(API_PROJECT) --context $(mod)DbContext
reindex: infra ## Rebuild the Meilisearch indexes from Postgres
dotnet run --project $(API_PROJECT) -- reindex
backfill-activations: infra ## Activate/queue members whose practice-repo PRs merged before the webhook existed
dotnet run --project $(API_PROJECT) -- backfill-activations