Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (62 loc) · 2.88 KB
/
Copy pathMakefile
File metadata and controls
89 lines (62 loc) · 2.88 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
SHELL := /bin/bash
export PATH := $(HOME)/.cargo/bin:$(PATH)
-include .env
export
.PHONY: install start stop status logs restart migrate seed k8s migrate-new prepare dev build test check audit gate gate-smoke bench-gate bench-gate-smoke clean image image-multiarch up down help
help:
@grep -h -E '^[a-zA-Z0-9_-]+:.*## ' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*## "}; {printf "%-20s %s\n", $$1, $$2}'
install: ## first-time install: Postgres, migrations, seed, router
./start.sh install
start: ## start Postgres, migrations, seed, and router via Docker Compose
./start.sh start
stop: ## stop the Docker Compose stack
./start.sh stop
status: ## show stack and endpoint status
./start.sh status
logs: ## follow router logs
./start.sh logs
restart: ## restart the stack via Docker Compose
./start.sh restart
migrate: ## run migrations against DATABASE_URL or the Compose Postgres
./start.sh migrate
seed: ## seed Default Team and provider templates
./start.sh seed
k8s: ## install to Kubernetes; pass ARGS="--replicas 2" if needed
./start.sh install --k8s $(ARGS)
migrate-new: ## make migrate-new NAME=add_teams
sqlx migrate add -r $(NAME)
prepare: ## generate .sqlx/ metadata for offline SQLx builds
cargo sqlx prepare
dev: ## run router locally with .env loaded by cargo runtime
cargo run
build: ## build production binary at target/release/brighto-router
cargo build --release --locked
test: ## run Rust tests; starts temporary Postgres if default DB is not reachable
./scripts/test_postgres.sh
check: ## fmt + hot-path guard + clippy
python3 scripts/hotpath_guard.py
cargo fmt --all -- --check
cargo clippy --locked --all-targets -- -D warnings
audit: ## run cargo-audit if installed
cargo audit
gate: ## release gate: check + tests + canonical mock benchmark
$(MAKE) check
$(MAKE) test
$(MAKE) bench-gate
gate-smoke: ## fast smoke gate; not release proof
$(MAKE) check
$(MAKE) bench-gate-smoke
bench-gate: ## full benchmark matrix -> bench/results/<ts>/
python3 scripts/bench_real.py
bench-gate-smoke: ## short benchmark smoke; does not enforce release thresholds
DUR=1s WARM=1s RUNS=1 CONCS=50 BENCH_B6=0 BENCH_B10=1 B10_TARGET_RPS=200 REQUIRE_PASS=0 python3 scripts/bench_real.py
clean: ## remove Rust build artifacts
cargo clean
image: ## build local Docker image for the current machine architecture
DOCKER_BUILDKIT=1 docker build -t $${IMAGE:-thusinh1969/brighto_airouter:local-dev} .
image-multiarch: ## publish multi-arch Docker image; usage: make image-multiarch TAG=v1.1.0
./scripts/docker_multiarch_release.sh $${TAG:-v1.1.0}
up: ## alias for start
./start.sh start
down: ## alias for stop
./start.sh stop