-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
138 lines (99 loc) · 2.52 KB
/
Copy pathMakefile
File metadata and controls
138 lines (99 loc) · 2.52 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.PHONY: dev dev-local dev-docker dev-docker-down dev-docker-build dev-docker-logs up down build logs clean test lint hosted-backend hosted-backend-down hosted-backend-logs docs-dev docs-build docs-preview docs-docker docs-docker-down docs-docker-logs
DEV_COMPOSE = docker compose -f docker-compose.dev.yml
HOSTED_COMPOSE = docker compose -f docker-compose.hosted.yml
DOCS_COMPOSE = docker compose -f docker-compose.docs.yml
# Development commands
dev: dev-local
dev-local:
bash scripts/dev/local_dev.sh
dev-docker:
$(DEV_COMPOSE) up --build -d
dev-docker-down:
$(DEV_COMPOSE) down
dev-docker-build:
$(DEV_COMPOSE) build
dev-docker-logs:
$(DEV_COMPOSE) logs -f
hosted-backend:
$(HOSTED_COMPOSE) up --build -d
hosted-backend-down:
$(HOSTED_COMPOSE) down
hosted-backend-logs:
$(HOSTED_COMPOSE) logs -f
docs-dev:
npm run docs:dev
docs-build:
npm run docs:build
docs-preview:
npm run docs:preview
docs-docker:
$(DOCS_COMPOSE) up --build -d
docs-docker-down:
$(DOCS_COMPOSE) down
docs-docker-logs:
$(DOCS_COMPOSE) logs -f
up:
docker compose up --build -d
down:
docker compose down
build:
docker compose build
logs:
docker compose logs -f
# Individual service logs
logs-web:
docker compose logs -f web
logs-api:
docker compose logs -f api
logs-worker:
docker compose logs -f worker
logs-redis:
docker compose logs -f redis
# Restart services
restart:
docker compose restart
restart-api:
docker compose restart api worker
restart-web:
docker compose restart web
# Clean up
clean:
docker compose down -v --rmi local
# Health check
health:
curl -s http://localhost:8000/health | jq
# Redis CLI
redis-cli:
docker compose exec redis redis-cli
# Shell access
shell-api:
docker compose exec api /bin/bash
shell-web:
docker compose exec web /bin/sh
# Status
ps:
docker compose ps
# Validate compose file
validate:
docker compose config
# Local QA
#
# `test` runs the pytest suite under api/tests/ (currently ~23 test files).
# `lint` remains the cheap sanity check (py_compile + ESLint).
test:
@set -eu; \
if [ -x "api/.venv/bin/python" ]; then PYTHON="api/.venv/bin/python"; \
elif [ -x ".venv/bin/python" ]; then PYTHON=".venv/bin/python"; \
else PYTHON="python3"; fi; \
cd api && "$${PYTHON}" -m pytest tests/ -q
lint: lint-api lint-web
lint-api:
@set -eu; \
if [ -x "api/.venv/bin/python" ]; then PYTHON="api/.venv/bin/python"; \
elif [ -x ".venv/bin/python" ]; then PYTHON=".venv/bin/python"; \
else PYTHON="python3"; fi; \
"$${PYTHON}" -m compileall -q api
lint-web:
@set -eu; \
cd web; \
npm run lint