-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (52 loc) · 1.11 KB
/
Makefile
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
APP_PATH = app
TESTS_PATH = tests
LOGS_SINCE = 10m
.PHONY: run
run:
docker-compose up db redis -d
uvicorn $(APP_PATH):app --host 0.0.0.0 --port 8000 --log-config logging.yaml
.PHONY: up
up:
docker-compose up --build -d
.PHONY: up-prod
up-prod:
docker-compose -f docker-compose.yml -f docker-compose-prod.yml up --build -d
.PHONY: db
db:
docker-compose exec -it db psql -U postgres -p changethis -d app
.PHONY: logs
logs:
docker-compose logs --since $(LOGS_SINCE) --follow
.PHONY: stop
stop:
docker-compose stop
.PHONY: restart
restart:
docker-compose restart
.PHONY: format
format:
ruff format $(APP_PATH) $(TESTS_PATH)
.PHONY: lint
lint:
ruff check $(APP_PATH) $(TESTS_PATH) --fix
mypy $(APP_PATH) --install-types --enable-incomplete-feature=NewGenericSyntax
PHONY: generate
generate:
docker-compose up -d
alembic revision --autogenerate
PHONY: upgrade
upgrade:
docker-compose up -d
alembic upgrade head
PHONY: downgrade
downgrade:
docker-compose up -d
alembic downgrade -1
PHONY: test
test:
docker-compose up -d
pytest $(TESTS_PATH) -s -v
# Windows only
PHONY: kill
kill:
TASKKILL /F /IM python.exe