This repository has been archived by the owner on Apr 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
96 lines (76 loc) · 2.04 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
# Progdupeupl's Makefile
#
# May provides useful targets in order to avoid a lot of typing when we want to
# run all the tests and other commands that require specific options.
MANAGE = manage.py
PMANAGE = venv/bin/python $(MANAGE)
FIXTURES = fixtures/auth.yaml \
fixtures/forum.yaml \
fixtures/member.yaml \
fixtures/messages.yaml \
fixtures/tutorial.yaml
ASSETS_DIR = ./assets/
# If you add a new target, do not forget to put it here so that make will not
# think your target is a real file.
.PHONY: tests \
test \
syncdb \
migrate \
initsearch \
updatesearch \
assets \
collectstatic \
loadfixtures \
coverage \
celery \
bootstrap \
cloc \
installdeps \
gitversion \
pep8
# Test all the project
tests:
$(PMANAGE) test
test: tests
# Synchronize the Django database with the models.
syncdb:
$(PMANAGE) syncdb --no-initial-data --noinput
# Run the South database migrations.
migrate:
$(PMANAGE) migrate
# Initialize the search engine and its cache.
initsearch:
$(PMANAGE) rebuild_index --noinput
# Update the search engine cache.
updatesearch:
$(PMANAGE) update_index
# Execute the Makefile in the assets directory.
assets:
cd $(ASSETS_DIR) && $(MAKE)
# Collect and process all the static content.
collectstatic:
$(PMANAGE) collectstatic --noinput
# Load fake data and put them in the database.
loadfixtures:
$(PMANAGE) loaddata $(FIXTURES)
# Launch coverage report.
coverage:
coverage run --source="." $(MANAGE) test $(TEST_APPS)
coverage html
# Start the celery tasks server
celery:
celery worker --app=pdp.celeryapp:app
# Initialize the whole project for the first time
bootstrap: installdeps syncdb migrate initsearch assets collectstatic loadfixtures updatesearch
mkdir -p media/tutorials
@echo "PDP Bootstrap finished!"
# Count lines of code, avoiding irrelevant files
cloc:
cloc . --exclude-dir='assets,__pycache__,venv,media,static,migrations,fixtures'
# Install dependencies
installdeps:
./install_dependencies.sh
gitversion:
git describe | tee git_version.txt
pep8:
flake8 --exclude=venv,'*/migrations/*',doc,pdp/wsgi.py .