-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (33 loc) · 1.02 KB
/
Copy pathMakefile
File metadata and controls
48 lines (33 loc) · 1.02 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
.PHONY: help up down build logs test lint clean ps shell migrate
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-18s\033[0m %s\n", $$1, $$2}'
up:
docker compose up -d --build
down:
docker compose down
build:
docker compose build app
logs:
docker compose logs -f app
ps:
docker compose ps
shell:
docker compose exec app sh
migrate:
docker compose exec app alembic upgrade head
migration:
docker compose exec app alembic revision --autogenerate -m "$(msg)"
rollback:
docker compose exec app alembic downgrade -1
test:
cd app && pytest tests/ -v --cov=. --cov-report=term-missing
lint:
flake8 app/ --max-line-length=100 --exclude=app/tests,app/migrations
health:
curl -s http://localhost:8000/health | python3 -m json.tool
metrics:
curl -s http://localhost:9090/metrics 2>/dev/null | head -20 || \
curl -s http://localhost:8000/metrics | head -20
clean:
docker compose down -v --remove-orphans