-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
85 lines (60 loc) · 2.1 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
.PHONY: update \
dependencies backend-dependencies frontend-dependencies \
test test-backend test-frontend \
check check-backend check-frontend \
db-setup db-migrate db-load-data admin \
export-data-to-csv logs
# -----------------------------------------------------------
update: dependencies logs db-setup
# -----------------------------------------------------------
dependencies: backend-dependencies frontend-dependencies
backend-dependencies:
@echo "== Install Python dependencies. =="
pip install -r requirements.txt
frontend-dependencies:
@echo "== Install frontend dependencies. =="
cd frontend && \
npm update && \
bower update && \
grunt development-build
# -----------------------------------------------------------
test: test-backend test-frontend
test-backend:
@echo "===== Backend tests ====="
python manage.py test --traceback
test-frontend:
@echo "===== Frontend tests ====="
cd frontend && \
grunt karma
# -----------------------------------------------------------
check: check-backend check-frontend
check-backend:
@echo "===== Backend linting ====="
pylint --reports=n --disable=E501,E225,E123,E128 --ignore=migrations,urls.py,wsgi.py practice
check-frontend:
@echo "===== Frontend linting ====="
cd frontend && \
grunt lint
# -----------------------------------------------------------
db-setup: db-flush db-migrate admin db-load-data
db-migrate:
@echo "===== Set up database ====="
python manage.py migrate --noinput
db-flush:
python manage.py flush --noinput
db-load-data:
python manage.py loaddata blocks/fixtures/blocks.xml
python manage.py loaddata blocks/fixtures/toolboxes.xml
python manage.py loaddata concepts/fixtures/concepts.xml
python manage.py loaddata tasks/fixtures/tasks.xml
python manage.py loaddata concepts/fixtures/instructions.json
admin:
python manage.py create_admin
# -----------------------------------------------------------
logs:
@mkdir -p logs >/dev/null
touch logs/practice.log
touch logs/requests.log
# -----------------------------------------------------------
export-data-to-csv:
python manage.py export_data_to_csv