-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
68 lines (57 loc) · 2.11 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
VIRTUAL_ENV ?= venv
SOURCE_DIRS = bplan django_zbp
.PHONY: install
install:
if [ ! -f $(VIRTUAL_ENV)/bin/python3 ]; then python3 -m venv $(VIRTUAL_ENV); fi
$(VIRTUAL_ENV)/bin/python3 -m pip install -r requirements.txt
$(VIRTUAL_ENV)/bin/python3 -m pip install -r requirements-dev.txt
$(VIRTUAL_ENV)/bin/python3 manage.py migrate
npm install --no-save
npm run build
.PHONY: fixtures
fixtures:
$(VIRTUAL_ENV)/bin/python3 manage.py loaddata django_zbp/fixtures/*-dev.json
$(VIRTUAL_ENV)/bin/python3 manage.py load_bezirke
$(VIRTUAL_ENV)/bin/python3 manage.py load_ortsteile
$(VIRTUAL_ENV)/bin/python3 manage.py load_bplan --fromFixtures
.PHONY: watch
watch:
trap 'kill %1' KILL; \
npm run watch & \
$(VIRTUAL_ENV)/bin/python3 manage.py runserver 8005
.PHONY: release
release: export DJANGO_SETTINGS_MODULE ?= django_zbp.settings.build
release:
npm install --no-save
npm run build:prod
$(VIRTUAL_ENV)/bin/python3 -m pip install -r requirements.txt -q
$(VIRTUAL_ENV)/bin/python3 manage.py collectstatic --noinput -v0 --ignore firebug-lite
.PHONY: clean
clean:
if [ -f package-lock.json ]; then rm package-lock.json; fi
if [ -d node_modules ]; then rm -rf node_modules; fi
if [ -d venv ]; then rm -rf venv; fi
.PHONY: lint
lint:
EXIT_STATUS=0; \
$(VIRTUAL_ENV)/bin/isort --diff -c $(SOURCE_DIRS) || EXIT_STATUS=$$?; \
$(VIRTUAL_ENV)/bin/flake8 $(SOURCE_DIRS) --exclude migrations,settings || EXIT_STATUS=$$?; \
$(VIRTUAL_ENV)/bin/python manage.py makemigrations --dry-run --check --noinput || EXIT_STATUS=$$?; \
exit $${EXIT_STATUS}
.PHONY: lint-quick
lint-quick:
EXIT_STATUS=0; \
$(VIRTUAL_ENV)/bin/python manage.py makemigrations --dry-run --check --noinput || EXIT_STATUS=$$?; \
exit $${EXIT_STATUS}
.PHONY: lint-python-files
lint-python-files:
EXIT_STATUS=0; \
$(VIRTUAL_ENV)/bin/black $(ARGUMENTS) || EXIT_STATUS=$$?; \
$(VIRTUAL_ENV)/bin/isort --diff -c $(ARGUMENTS) --filter-files || EXIT_STATUS=$$?; \
$(VIRTUAL_ENV)/bin/flake8 $(ARGUMENTS) || EXIT_STATUS=$$?; \
exit $${EXIT_STATUS}
.PHONY: lint-fix
lint-fix:
EXIT_STATUS=0; \
$(VIRTUAL_ENV)/bin/isort $(SOURCE_DIRS) || EXIT_STATUS=$$?; \
exit $${EXIT_STATUS}