forked from numerique-gouv/sites-faciles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (53 loc) · 1.67 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
# Loading environment variables
ifneq (,$(wildcard ./.env))
include .env
export
endif
ifeq ($(USE_DOCKER),1)
EXEC_CMD := docker-compose exec -ti web
else
EXEC_CMD :=
endif
.PHONY: web-prompt
web-prompt:
$(EXEC_CMD) bash
.PHONY: test-unit
test-unit:
$(EXEC_CMD) poetry run python manage.py test --settings sites_faciles.config.settings_test
.PHONY: collectstatic
collectstatic:
$(EXEC_CMD) poetry run python manage.py collectstatic --noinput --ignore=*.sass
.PHONY: messages
messages:
$(EXEC_CMD) poetry run django-admin makemessages -l fr --ignore=manage.py --ignore=medias --ignore=setup.py --ignore=staticfiles --ignore=templates
.PHONY: sass
sass:
$(EXEC_CMD) poetry run python manage.py compilescss
make collectstatic
.PHONY: quality
quality:
$(EXEC_CMD) poetry run black --check --exclude=venv .
$(EXEC_CMD) poetry run isort --check --skip-glob="**/migrations" --extend-skip-glob="venv" .
$(EXEC_CMD) poetry run flake8 --count --show-source --statistics --exclude="venv,**/migrations" .
.PHONY: fix
fix:
$(EXEC_CMD) poetry run black --exclude=venv .
$(EXEC_CMD) poetry run isort --skip-glob="**/migrations" --extend-skip-glob="venv" .
.PHONY: init
init:
$(EXEC_CMD) poetry install
$(EXEC_CMD) poetry run pre-commit install
$(EXEC_CMD) poetry run python manage.py migrate
make collectstatic
$(EXEC_CMD) poetry run python manage.py set_config
$(EXEC_CMD) poetry run python manage.py create_starter_pages
.PHONY: demo
demo:
make init
$(EXEC_CMD) poetry run python manage.py create_demo_pages
.PHONY: runserver
runserver:
$(EXEC_CMD) poetry run python manage.py runserver $(DJANGO_HOST):$(DJANGO_PORT)
.PHONY: test
test:
$(EXEC_CMD) poetry run python manage.py test