forked from tlatorre-uchicago/minard
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathMakefile
48 lines (41 loc) · 1.38 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
default: build
INSTALL=install
.DEFAULT:
./setup.py $@
build:
./setup.py build
docs:
$(MAKE) -C docs html
@mkdir -p minard/static/docs
cp -r docs/_build/html/* minard/static/docs
/opt/minard/bin/activate:
virtualenv --system-site-packages /opt/minard
install: /opt/minard/bin/activate
# clean the build/ directory since it contains scripts with the shebang
# pointing to /usr/bin/python after running make build
python setup.py clean --all
/opt/minard/bin/pip install .
# reinstall minard with -I flag so that it reinstalls even
# if the version doesn't change
/opt/minard/bin/pip install --no-deps -I .
# need to install gunicorn in virtual environment so that the
# script /opt/minard/bin/gunicorn exists
/opt/minard/bin/pip install gunicorn
mkdir -p /var/www/minard
# copy static files to /var/www/minard so that nginx
# can serve them instead of flask
cp -r minard/static /var/www/minard
$(INSTALL) init/gunicorn /etc/init.d/
$(INSTALL) init/gunicorn_snoplus_log /etc/init.d/
$(INSTALL) init/minard-dispatch /etc/init.d/
$(INSTALL) init/minard-cmos /etc/init.d/
$(INSTALL) init/minard-base /etc/init.d/
$(INSTALL) init/baseline_monitor /etc/init.d/
chkconfig gunicorn on
chkconfig gunicorn_snoplus_log on
chkconfig minard-dispatch on
chkconfig minard-cmos on
chkconfig minard-base on
chkconfig baseline_monitor on
service gunicorn restart
.PHONY: install build docs