forked from c4all/c4all
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·77 lines (57 loc) · 1.7 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
MANAGE=python manage.py
PROJECT_NAME=c4all
SETTINGS=--settings=$(PROJECT_NAME).settings.test
LESS=lessc
FLAKE8_OPTS=--exclude=.git,migrations --max-complexity=10
.PHONY: all test coverage clean requirements update \
ensure_virtualenv reqs/dev reqs/test reqs/prod dev-setup
all: coverage
test:
$(MANAGE) test --where=. $(SETTINGS) --with-xunit
coverage:
$(MANAGE) test --where=. $(SETTINGS) \
--with-xcoverage --with-xunit --cover-html --cover-erase
clean:
rm -rf .coverage cover nosetests.xml coverage.xml
rm -rf $(PROJECT_NAME)/static/CACHE
find . -name '*.pyc' -exec rm '{}' ';'
lint:
flake8 $(FLAKE8_OPTS) .
ensure_virtualenv:
@if [ -z $$VIRTUAL_ENV ]; then \
echo "Please run me inside virtualenv."; \
exit 1; \
fi
reqs/dev: ensure_virtualenv
pip install -r requirements/dev.txt
reqs/test: ensure_virtualenv
pip install -r requirements/test.txt
reqs/prod: ensure_virtualenv
pip install -r requirements/prod.txt
dev-setup: ensure_virtualenv reqs/dev
if [ ! -f $(PROJECT_NAME)/settings/local.py ]; then \
echo 'from .dev import *' > $(PROJECT_NAME)/settings/local.py; \
fi
$(MANAGE) syncdb --all
$(MANAGE) migrate --fake
test-setup: ensure_virtualenv reqs/test
dev-update: ensure_virtualenv reqs/dev
$(MAKE) update
prod-update: ensure_virtualenv reqs/prod
$(MAKE) update
update: ensure_virtualenv
$(MAKE) clean
$(MANAGE) syncdb
$(MANAGE) migrate
$(MANAGE) compilemessages
$(MAKE) less
$(MANAGE) collectstatic --noinput
less:
$(LESS) c4all/staticfiles/admin_ui/less/style.less \
> c4all/staticfiles/admin_ui/css/style.css
$(LESS) c4all/staticfiles/less/style.less \
> c4all/staticfiles/css/style.css
deploy:
git pull
$(MAKE) prod-update
sudo restart c4all-web