Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (74 loc) · 2.18 KB
/
Copy pathMakefile
File metadata and controls
81 lines (74 loc) · 2.18 KB
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
include .env
DC = $(SUDO) docker-compose -f $(YML)
DUMP = /docker-entrypoint-initdb.d/dump.sql
PY = $(DC) exec dms-backend
MNG = $(DC) exec dms-backend python manage.py
NODE = $(DC) exec dms-frontend
#======================= CONTAINERS_MANAGEMENT =========================
#=======================================================================
# build and run containers and remove orphan containers
buildup:
$(DC) up --build --remove-orphans
up:
$(DC) up
down:
$(DC) down
# down + volumes
down-v:
$(DC) down -v
logs:
$(DC) logs
#======================= POSTGRESQL_DB =================================
#=======================================================================
db-dump:
$(DC) exec postgres /bin/sh -c\
"pg_dump $(DATABASE_NAME) -U $(DATABASE_USERNAME) -h $(DATABASE_HOST) > $(DUMP)"
db-load:
$(DC) exec postgres /bin/sh -c\
"psql -d $(DATABASE_NAME) -U $(DATABASE_USERNAME) -h $(DATABASE_HOST) < $(DUMP)"
#======================= PYTHON_DJANGO =================================
#=======================================================================
# open Django terminal
shell:
$(MNG) shell
# apply changes to database
migrate:
$(MNG) migrate --noinput
# check for changes in database
makemigrations:
$(MNG) makemigrations
# create new superuser for admin django login
superuser:
$(MNG) createsuperuser
collectstatic:
$(MNG) collectstatic --no-input --clear
jupyter:
$(MNG) shell_plus --notebook
db-diagram:
$(MNG) graph_models utils users administrative_area civic_structure landform tourist_attraction -g -n -o db_diagram.png
flake8:
$(PY) flake8 .
black:
$(PY) black --check .
black-diff:
$(PY) black --diff .
black-exec:
$(PY) black .
pytest:
$(PY) pytest -p no:warnings --cov=.
pytest-html:
$(PY) pytest -p no:warnings --cov=. --cov-report html
isort:
$(PY) isort . --check-only --skip venv --skip migrations
isort-diff:
$(PY) isort . --diff --skip venv --skip migrations
isort-exec:
$(PY) isort . --skip venv --skip migrations
#======================= NODEJS_REACT ==================================
#=======================================================================
build-node:
$(NODE) npm run build
eslint:
$(NODE) npm run lint
prettier:
$(NODE) npm run format