-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (52 loc) · 1.51 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
67
68
69
70
71
CONTAINER_NAME = app
RUN_APP = docker-compose exec $(CONTAINER_NAME)
RUN_POETRY = $(RUN_APP) poetry run
RUN_DJANGO = $(RUN_POETRY) python manage.py
RUN_PYTEST = $(RUN_POETRY) pytest
DOCS = docs
REPORT_URL = http://127.0.0.1:5050/allure-docker-service/projects/$(PROJECT)/reports/latest/index.html
up:
docker-compose up -d
build:
docker-compose build
down:
docker-compose down
clean:
docker-compose down --rmi all --volumes --remove-orphans
loaddata:
$(RUN_DJANGO) loaddata fixture.json
makemigrations:
$(RUN_DJANGO) makemigrations
migrate:
$(RUN_DJANGO) migrate
show_urls:
$(RUN_DJANGO) show_urls
shell:
$(RUN_DJANGO) debugsqlshell
superuser:
$(RUN_DJANGO) createsuperuser
test:
$(RUN_PYTEST)
test-cov:
$(RUN_PYTEST) --cov
docs:
$(RUN_POETRY) pdoc application/tests --html -o $(DOCS) --force
make_report:
curl -X POST "http://127.0.0.1:5050/allure-docker-service/projects" -H "accept: */*" -H "Content-Type: application/json" -d "{\"id\":\"$(PROJECT)\"}"
-@ $(RUN_PYTEST) --alluredir=allure-results
sh send_results.sh
echo "Generating test report. This may take a while..."
curl -X GET "http://127.0.0.1:5050/allure-docker-service/generate-report?project_id=$(PROJECT)" -H "accept: */*"
echo "Successfully generated test report. Redirecting to allure server."
open $(REPORT_URL)
show_report:
open $(REPORT_URL)
format:
$(RUN_POETRY) black .
$(RUN_POETRY) isort .
update:
$(RUN_APP) poetry update
db:
docker exec -it db bash
pdoc:
$(RUN_APP) env CI_MAKING_DOCS=1 poetry run pdoc -o docs application