-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (58 loc) · 1.66 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
#!/usr/bin/make -f
PYTHON = python
VENV = .venv
PORT = 8008
DATABASE_URL ?= postgres://vydej:vydej@localhost:5432/vydej
export DATABASE_URL
help:
@echo "Setup:"
@echo " venv Setup virtual environment"
@echo " install Install dependencies to venv"
@echo " install-hooks Install pre-commit hooks"
@echo " hooks Run pre-commit hooks manually"
@echo ""
@echo "Application:"
@echo " run Run the application on port ${PORT}"
@echo " shell Run Django shell"
@echo ""
@echo "Database:"
@echo " migrations Generate migrations"
@echo " migrate Run migrations"
@echo ""
@echo "Testing:"
@echo " test Run tests"
@echo " coverage Coverage report"
@echo ""
@echo "Docker:"
@echo " build Build image"
@echo " release Upload image"
@echo ""
venv: .venv/bin/python
.venv/bin/python:
${PYTHON} -m venv ${VENV}
install: venv
${VENV}/bin/pip install -r requirements/base.txt -r requirements/dev.txt
install-hooks:
pre-commit install --install-hooks
hooks:
pre-commit run -a
run: venv
${VENV}/bin/python manage.py runserver ${PORT}
shell: venv
${VENV}/bin/python manage.py shell_plus
migrations: venv
${VENV}/bin/python manage.py makemigrations
migrate: venv
${VENV}/bin/python manage.py migrate
test:
${VENV}/bin/pytest
coverage:
${VENV}/bin/pytest --cov --cov-report term-missing
build:
docker build -t vydej-materialu:latest .
release:
docker tag vydej-materialu:latest janbednarik/vydej-materialu:latest
docker push janbednarik/vydej-materialu:latest
.PHONY: help venv install install-hooks hooks run shell
.PHONY: migrations migrate build release
# EOF