-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
51 lines (36 loc) · 1.24 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
.PHONY: update-deps build up down attach bash shell migrate migrations collectstatic run-build run tests circleci-up circleci-tests
update-deps:
pip install -U pip && pip install pip-tools
pip-compile requirements/base.in
pip-compile requirements/dev.in
REQUIREMENTS_FILE = dev.txt
build:
docker compose build --build-arg="REQUIREMENTS_FILE=$(REQUIREMENTS_FILE)"
up:
make build
docker compose up
down:
docker compose down
attach:
docker attach myproject
bash:
docker exec -it myproject bash
shell:
docker exec -it myproject python manage.py shell_plus --ipython
migrate:
docker exec -it myproject python manage.py migrate
migrations:
docker exec -it myproject python manage.py makemigrations
collectstatic:
docker exec -it myproject python manage.py collectstatic
run-build:
docker build . -f docker/Dockerfile -t myproject:latest --build-arg="REQUIREMENTS_FILE=$(REQUIREMENTS_FILE)"
run:
docker run --name myproject -p 8000:8000 --rm --env-file .env -it myproject:latest
tests:
docker exec -it myproject pytest -s --verbose
circleci-up:
make build
docker compose -f docker-compose-circleci.yml up -d
circleci-tests:
docker exec -it myproject pytest -v --cov=./ --cov-config=tests/.coveragerc --junitxml=/src/test-results/junit.xml