-
Notifications
You must be signed in to change notification settings - Fork 131
/
Makefile
85 lines (65 loc) · 1.86 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
REGION ?= nyc3
ENV ?= dev
LIMIT ?= $(REGION)-$(ENV)-boltstream-me
TAGS ?= all
PYCURL_SSL_LIBRARY ?= openssl
OPENSSL_PREFIX ?= $(shell brew --prefix openssl)
LDFLAGS ?= "-L$(OPENSSL_PREFIX)/lib"
CPPFLAGS ?= "-I$(OPENSSL_PREFIX)/include"
venv:
python3 -m venv venv
deps:
python -m pip install --upgrade pip wheel
PYCURL_SSL_LIBRARY=$(PYCURL_SSL_LIBRARY) \
LDFLAGS=$(LDFLAGS) CPPFLAGS=$(CPPFLAGS) \
python -m pip install --requirement=requirements.txt
freeze:
python -m pip freeze > requirements.txt
migrate:
./manage.py migrate --noinput
migrations:
./manage.py makemigrations
statics:
./manage.py collectstatic --noinput
test:
./manage.py test
dumpinitialdata:
./manage.py dumpdata --natural-foreign --natural-primary \
--exclude=admin.logentry --all --indent=2 > boltstream/fixtures/initial_data.json
loadinitialdata:
./manage.py loaddata initial_data
dumptestdata:
./manage.py dumpdata --natural-foreign --natural-primary \
--exclude=admin.logentry --all --indent=2 > boltstream/fixtures/tests.json
loadtestdata:
./manage.py loaddata tests
coverage:
coverage run ./manage.py test
coverage html --include=boltstream/*
lint:
flake8 boltstream
black --check boltstream
format:
isort --atomic boltstream
black boltstream
clean:
rm -rf venv media static db.sqlite3 staticfiles.json
$(MAKE) venv
mkdir media
sh -c "./bin/boot $(MAKE) deps migrate loadinitialdata statics"
cleandb:
rm -f db.sqlite3
$(MAKE) migrate loadinitialdata
run:
./manage.py runserver
shell:
./manage.py shell
deploy:
ANSIBLE_CONFIG=ansible/ansible.cfg \
ansible-playbook \
--inventory=ansible/digital_ocean.py --tags="$(TAGS)" \
--limit="$(LIMIT)" --extra-vars="region=$(REGION) env=$(ENV)" ansible/site.yml
restart:
ANSIBLE_CONFIG=ansible/ansible.cfg \
ansible "$(LIMIT)" --inventory=ansible/digital_ocean.py \
--module-name=service --args="name=$(NAME) state=restarted"