Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (63 loc) · 2.65 KB
/
Copy pathMakefile
File metadata and controls
78 lines (63 loc) · 2.65 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
PYTHON := $(if $(wildcard .venv/bin/python),.venv/bin/python,python3)
WORKSPACE_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..)
.PHONY: dev stop logs doctor schema-docs schema-docs-check schema-docs-reset-check ci-local repo-map repo-map-check \
pipeline-run pipeline-run-all pipeline-status pipeline-list
dev:
@$(MAKE) -C $(WORKSPACE_ROOT) dev
stop:
@$(MAKE) -C $(WORKSPACE_ROOT) stop
logs:
@$(MAKE) -C $(WORKSPACE_ROOT) logs
# Environment diagnostic - run before pytest to verify setup
doctor:
@$(PYTHON) scripts/dev/doctor.py
# Generate schema docs (JSON, MD) and diagrams (Mermaid) from database
schema-docs:
@$(PYTHON) scripts/supabase/generate_schema_docs.py
# Verify schema docs and diagrams are in sync with the selected validation database.
# Preferred contract: push migrations to an isolated remote branch/disposable DB,
# export TRR_DB_URL to that target, then run:
# supabase db push --db-url "$TRR_DB_URL" --include-all && make schema-docs-check
# Local Docker-backed replay is fallback-only when you intentionally need a fully
# local reset:
# supabase start && supabase db reset --yes && make schema-docs-check
schema-docs-check:
@$(PYTHON) scripts/supabase/generate_schema_docs.py
git diff --exit-code supabase/schema_docs
# Reset a local Supabase database to migrations and verify schema docs are in sync.
# This is an explicit Docker-backed fallback for local replay work, not the default
# milestone verification path.
schema-docs-reset-check:
@echo "Resetting database to migrations..."
@supabase db reset --yes
@echo "Verifying schema docs..."
@$(MAKE) schema-docs-check
# Docker-backed local CI lane for fully local replay parity only.
ci-local:
@bash -c 'set -euo pipefail; \
trap "supabase stop --no-backup" EXIT; \
docker info >/dev/null; \
supabase start --exclude gotrue,realtime,storage-api,imgproxy,kong,mailpit,postgrest,postgres-meta,studio,edge-runtime,logflare,vector,supavisor; \
supabase db reset --yes; \
"$(PYTHON)" -m pytest; \
$(MAKE) schema-docs-check'
repo-map:
@$(PYTHON) scripts/generate_repo_mermaid.py
repo-map-check:
@$(PYTHON) scripts/generate_repo_mermaid.py
@if git diff --quiet docs/Repository/generated/; then \
echo "✅ Repository maps are up to date"; \
else \
echo "❌ Repository maps are out of date. Run 'make repo-map' and commit."; \
git diff docs/Repository/generated/; \
exit 1; \
fi
# Pipeline orchestration commands
pipeline-run:
@$(PYTHON) -m trr_backend.cli pipeline run $(ARGS)
pipeline-run-all:
@$(PYTHON) -m trr_backend.cli pipeline run --all
pipeline-status:
@$(PYTHON) -m trr_backend.cli pipeline status $(RUN_ID)
pipeline-list:
@$(PYTHON) -m trr_backend.cli pipeline list