Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (71 loc) · 3.74 KB
/
Copy pathMakefile
File metadata and controls
93 lines (71 loc) · 3.74 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.PHONY: help auth start stop api web api-test web-test web-build web-lint database download restore build scaffold gen-models
WORKSPACE := /workspace
BUILD_DIR := $(WORKSPACE)/Build
API_PORT ?= 8250
WEB_PORT ?= 8252
# ESA laptops: Cato TLS inspection re-signs platform.claude.com, so the Claude CLI that local AI
# extraction runs (NPT-1133) must trust the Cato root. When the developer has exported it (see
# CLAUDE.md), hand it to everything make starts; elsewhere the file is absent and this is a no-op.
CORP_ROOT_CERT := $(WORKSPACE)/docker-compose/corp-root.crt
ifneq ($(wildcard $(CORP_ROOT_CERT)),)
export NODE_EXTRA_CA_CERTS ?= $(CORP_ROOT_CERT)
endif
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
auth: ## One-time sign-in to Azure (az) + GitHub (gh); persists in shared volumes
cd $(BUILD_DIR) && bash auth.sh
# --- App ---
start: stop ## Start API and web dev server in parallel (frees stale ports first)
@trap 'kill 0' EXIT; \
$(MAKE) api & \
$(MAKE) web & \
wait
stop: ## Kill stray API/web dev servers from a previous run (frees ports $(API_PORT)/$(WEB_PORT))
@echo "Freeing dev ports (killing any stray watchers/servers from a previous run)..."
-@pkill -9 -f "Neptune\.API" 2>/dev/null
-@pkill -9 -f "ng serve" 2>/dev/null
@sleep 1
api: ## Start API with hot-reload on port $(API_PORT) (Hangfire runs in-process)
cd $(WORKSPACE) && dotnet watch --project Neptune.API -- run --urls http://+:$(API_PORT)
api-test: ## Run .NET tests
cd $(WORKSPACE) && dotnet test Neptune.Tests/Neptune.Tests.csproj
# --- Web ---
# HTTPS with the tracked *.localhost.sitkatech.com certificate (Neptune.Web/server.crt), the one
# Windows `npm start` uses. Browse https://neptune.localhost.sitkatech.com:$(WEB_PORT) — Auth0 returns
# to that origin, which must be registered in the Auth0 app (8252 is). The devcontainer configuration
# points the SPA at this container's API (API_PORT).
# --allowed-hosts because the browser sends the neptune.localhost.sitkatech.com Host header.
web: ## Start Angular dev server on https://neptune.localhost.sitkatech.com:$(WEB_PORT)
cd $(WORKSPACE)/Neptune.Web && npx --yes ng serve --configuration devcontainer --host 0.0.0.0 --port $(WEB_PORT) \
--ssl --ssl-cert server.crt --ssl-key server.key --allowed-hosts --poll 2000
web-test: ## Run Angular unit tests
cd $(WORKSPACE)/Neptune.Web && npm test
web-build: ## Build Angular for production
cd $(WORKSPACE)/Neptune.Web && npm run build-prod
web-lint: ## Lint Angular code
cd $(WORKSPACE)/Neptune.Web && npm run lint
# --- Database (chain: make download restore build scaffold) ---
database: ## Database context (chain with: download restore build scaffold)
@echo ""
@echo " Database targets — chain any combination after 'make database':"
@echo ""
@echo " \033[36mdownload\033[0m Download BACPAC from Azure (requires az login)"
@echo " \033[36mrestore\033[0m Restore database from BACPAC"
@echo " \033[36mbuild\033[0m Build DacPac and deploy schema"
@echo " \033[36mscaffold\033[0m Scaffold EF Core entities + run the POCO generator"
@echo ""
@echo " Examples:"
@echo " make download restore build scaffold"
@echo " make build scaffold"
@echo ""
download: ## Download BACPAC from Azure
cd $(BUILD_DIR) && bash database-download.sh
restore: ## Restore database from BACPAC
cd $(BUILD_DIR) && bash database-restore.sh
build: ## Build DacPac and deploy schema
cd $(BUILD_DIR) && bash database-build.sh
scaffold: ## Scaffold EF Core entities + run the POCO generator
cd $(BUILD_DIR) && bash scaffold.sh
# --- Code generation ---
gen-models: ## Regenerate TypeScript models from swagger.json
cd $(WORKSPACE)/Neptune.Web && npm run gen-model