-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
99 lines (70 loc) · 1.95 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
99
PYTHON = python
REPO = datashaman/wifidog-auth-flask
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
RELEASE = $(subst master,latest,$(BRANCH))
TAG = $(REPO):$(RELEASE)
tmuxp:
tmuxp load .
serve:
python serve.py
serve-production:
gunicorn --reload -b '127.0.0.1:5000' 'auth:create_app()'
db-reset:
rm -rf data/local.db
python manage.py bootstrap_instance
build-static:
npm install
gulp
docker-prepare: clean
docker-build: docker-prepare
docker build -t $(TAG) .
docker-push:
docker push $(TAG)
docker-run:
docker run --env-file .env -p 5000:5000 -i -t $(TAG)
docker-run-persistent:
docker run --env-file .env -p 5000:5000 -v auth-data:/var/app/data -i -t $(TAG)
docker-prune-stopped:
docker ps -a -q | xargs -r docker rm
docker-prune-untagged:
docker images | grep '^<none>' | awk '{print $$3}' | xargs -r docker rmi
docker-prune: docker-prune-stopped docker-prune-untagged
browser-sync:
browser-sync start --proxy http://127.0.0.1:5000 --files="auth/**"
lint:
pylint auth
bootstrap-local: bootstrap-tests
cp tests/tests.db data/local.db
bootstrap-tests:
rm -rf tests/tests.db && touch tests/tests.db
TESTING=true $(PYTHON) manage.py bootstrap_tests
watch:
while inotifywait -e close_write -r ./auth/*.py ./auth/templates ./tests; do make test; done
test:
TESTING=true $(PYTHON) -m unittest discover -s tests
coverage:
TESTING=true coverage run --include='auth/*' -m unittest discover -s tests
coveralls
setup:
sudo -H apt-get install python-pip virtualenvwrapper libjpeg-dev libpng-dev libffi-dev
sudo -H npm -g install gulp
development-install:
pip install -r requirements.txt
npm install
gulp --dev
production-install:
pip install -r requirements.txt
npm install
gulp
bootstrap:
$(PYTHON) bootstrap.py
remove-db:
rm -f local.db
reboot: remove-db bootstrap
clean:
find . -name '*.pyc' -delete
rm -rf auth/static/{fonts,scripts,styles}/*
graphs:
$(PYTHON) auth/graphs.py
dot:
dot -Tpng -O auth/graphs.dot && eog auth/graphs.dot.png