-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (50 loc) · 1.08 KB
/
Makefile
File metadata and controls
64 lines (50 loc) · 1.08 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
project_dir := .
# Lint code
.PHONY: lint
lint:
@poetry run black --check --diff $(project_dir)
@poetry run ruff check $(project_dir)
@poetry run mypy $(project_dir) --strict
# Reformat code
.PHONY: reformat
reformat:
@poetry run black $(project_dir)
@poetry run ruff check $(project_dir) --fix
# Make database migration
.PHONY: migration
migration:
poetry run alembic revision \
--autogenerate \
--rev-id $(shell python migrations/_get_next_revision_id.py) \
--message $(message)
.PHONY: migrate
migrate:
poetry run alembic upgrade head
.PHONY: app-build
app-build:
docker compose build
.PHONY: app-run-db
app-run-db:
docker compose stop
docker compose up -d postgres --remove-orphans
.PHONY: app-run
app-run:
docker compose stop
docker compose up -d --remove-orphans
.PHONY: app-stop
app-stop:
docker compose stop
.PHONY: app down
app-down:
docker compose down
.PHONY: app-destroy
app-destroy:
docker compose down -v --remove-orphans
.PHONY: app-logs
app-logs:
docker compose logs -f fastapi
.PHONY: app-pull
app-pull:
git pull
$(MAKE) app-build
$(MAKE) app-run