-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (41 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
APPS=tachovendo
venv_boot:
mkvirtualenv --distribute --python=/usr/local/bin/python -r requirements.txt tachovendo_proj
runserver:
python manage.py runserver
test:
python manage.py test $(APPS)
dbreset:
dropdb tachovendo_proj && createdb tachovendo_proj && rm -rf tachovendo/migrations
dbinitial:
python manage.py schemamigration --initial $(APPS) && python manage.py syncdb --noinput && python manage.py createsuperuser --user admin --email [email protected]
server_dbinitial:
python manage.py syncdb --noinput && python manage.py createsuperuser --user admin --email [email protected]
schemamigration:
python manage.py schemamigration --auto $(APPS)
migrate:
python manage.py migrate $(APPS)
migrate_no_input:
python manage.py migrate --noinput $(APPS)
update_deps:
sudo pip install -r requirements.txt
coverage:
coverage run --source="$(shell pwd)" manage.py test $(APPS)
coverage html --include="$(shell pwd)*" --omit="admin.py,manage.py,fabfile.py"
clean:
rm -rf htmlcov
# Tasks with parameters
# make add_app app_name -> create an new app with app_name
ifneq ($(filter$(MAKECMDGOALS),with_args), "")
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
with_args=new_app,app_schemamigration
new_app:
django-admin.py startapp --template=https://github.com/loogica/loogica_app_template/archive/master.zip $(RUN_ARGS)
@echo Add this App to your settings INSTALLED_APPS and then run 'make app_schemamigration $(RUN_ARGS)'
app_schemamigration:
python manage.py schemamigration --initial $(RUN_ARGS)
python manage.py migrate $(RUN_ARGS)