-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·68 lines (58 loc) · 1.98 KB
/
Makefile
File metadata and controls
executable file
·68 lines (58 loc) · 1.98 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
.PHONY: all
all:
.PHONY: certs
certs:
@echo "🔐 [Certificates] Generating self-signed certificates for SpiceDB..."
@mkdir -p certs
@if [ ! -f certs/spicedb-cert.pem ] || [ ! -f certs/spicedb-key.pem ]; then \
openssl req -x509 -newkey rsa:4096 \
-keyout certs/spicedb-key.pem \
-out certs/spicedb-cert.pem \
-days 365 -nodes \
-subj "/CN=spicedb/O=Kartograph Dev" \
-addext "subjectAltName=DNS:spicedb,DNS:localhost,IP:127.0.0.1"; \
chmod 555 certs/spicedb-cert.pem certs/spicedb-key.pem; \
echo "✓ Certificates generated in certs/"; \
echo " → Available for local tests via certs/spicedb-cert.pem"; \
else \
echo "✓ Certificates already exist in certs/"; \
fi
.PHONY: dev
dev: certs
@echo "🧰 [Development] Starting application containers..."
docker compose -f compose.yaml build
docker compose -f compose.yaml -f compose.dev.yaml --profile ui up -d
@echo "Done."
@echo "----------------------------"
@echo "API Root: http://localhost:8000"
@echo "API Docs: http://localhost:8000/docs/"
@echo "Dev UI: http://localhost:3000"
@echo "----------------------------"
.PHONY: down
down:
docker compose -f compose.yaml -f compose.dev.yaml down
.PHONY: run
run:
@echo "🖥 [Non-Development] Starting application containers..."
docker compose -f compose.yaml build
docker compose -f compose.yaml up -d
@echo "Done."
@echo "----------------------------"
@echo "API Root: http://localhost:8000"
@echo "API Docs: http://localhost:8000/docs/"
@echo "----------------------------"
.PHONY: logs
logs:
docker compose logs --tail 1000 --follow
.PHONY: docs-export
docs-export:
.PHONY: docs-export
docs-export:
@echo "📝 Exporting system properties to JSON..."
cd src/api && uv run python ../../scripts/export_system_properties.py
@echo "⚙️ Exporting environment variables to JSON..."
cd src/api && uv run python ../../scripts/export_settings.py
.PHONY: docs
docs: docs-export
@echo "🌐 Starting documentation dev server..."
cd website && npm i && npm run dev