forked from Hexlet/hexlet-friends
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (67 loc) · 2.08 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.env:
test ! -f .env && cp .env.example .env
build-production:
poetry install --extras psycopg2-binary
$(MAKE) collectstatic
build:
poetry install --extras psycopg2-binary
poetry run python manage.py migrate
check: lint test requirements.txt
collectstatic:
poetry run python manage.py collectstatic --no-input
compose-build: .env
docker compose build
compose-clear:
docker compose down -v || true
compose-down:
docker compose down || true
compose-setup: compose-build
docker compose run --rm django make setup
compose-start:
docker compose up --abort-on-container-exit
compose-stop:
docker compose stop || true
compose-sync:
docker compose run --rm django make sync ARGS="$(ARGS)"
deploy:
git push heroku
setup-pre-commit-hooks:
poetry run pre-commit install
install-dependencies: .env
poetry install --extras psycopg2-binary
install: install-dependencies setup-pre-commit-hooks
lint:
poetry run flake8
migrate:
poetry run python manage.py migrate
requirements.txt: poetry.lock
poetry export --format requirements.txt --output requirements.txt --extras psycopg2 --without-hashes
secretkey:
poetry run python -c 'from django.utils.crypto import get_random_string; print(get_random_string(40))'
setup: migrate
echo Create a super user
poetry run python manage.py createsuperuser
shell:
poetry run python manage.py shell_plus --plain
start-deploy:
gunicorn config.wsgi
start-production:
gunicorn -b 0.0.0.0:8000 config.wsgi:application
start:
poetry run python manage.py runserver 0.0.0.0:8000
sync:
poetry run python manage.py fetchdata $(ARGS)
test-coverage-report-xml:
poetry run coverage xml
test-coverage-report: test
poetry run coverage report -m $(ARGS)
poetry run coverage erase
test:
poetry run coverage run --source='.' manage.py test
transcompile:
poetry run django-admin compilemessages
# Need to have GNU gettext installed
transprepare:
poetry run django-admin makemessages --locale ru --add-location file
poetry run django-admin makemessages --locale ru --add-location file --domain djangojs
.PHONY: install setup shell lint test check start sync secretkey