-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (39 loc) · 1.36 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
export PYTHONDONTWRITEBYTECODE=1
container_name = 'app-api'
pytest_workers = 3
help:
@echo
@echo build .................... : Build local containers
@echo run ...................... : Run local containers
@echo stop ..................... : Stop local containers
@echo down ..................... : Stop and delete local container
@echo makemigrations ........... : Django makemigrations command
@echo migrate .................. : Django migrate command
@echo createsuperuser .......... : Django createsuperuser command
@echo shell .................... : Django shell command
@echo sh ....................... : SSH into local API container
@echo linter ................... : Run Ruff linter against all files in this repo
@echo test ..................... : Run automated tests
@echo
build: down
docker compose build --no-cache
run:
docker compose up
stop:
docker compose stop
down: stop
docker compose down --remove-orphans --rmi all
makemigrations:
docker compose run app python manage.py makemigrations
migrate:
docker compose run app python manage.py migrate
createsuperuser:
docker compose run app python manage.py createsuperuser --no-input
shell:
docker compose run app python manage.py shell -i ipython
sh:
docker exec -it $(container_name) /bin/sh
linter:
pre-commit run --all-files
test:
pytest -n $(pytest_workers) --cov=src/ --import-mode=importlib