-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
66 lines (53 loc) · 2.33 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
# Project : Data Central
# -----------------------------------------------------------------------------
# Author : Ricardo Lafuente <r@manufacturaindependente.org>
# -----------------------------------------------------------------------------
# License : GNU General Public License
# -----------------------------------------------------------------------------
# This file is part of the Data Central package.
#
# Data Central is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Data Central is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Data Central. If not, see <http://www.gnu.org/licenses/>.
# This is *heavily* based on Edouard Richard's excellent Makefiles.
# See https://github.com/jplusplus/resonate2014/blob/master/Makefile for
# the basis from where this file was created.
# your SSH target dir for rsync (set this in the environment)
#SSH_PATH = "wf:~/webapps/centraldedados/"
# server port for local server
SERVER_PORT = 8002
MAIN_SCRIPT = $(wildcard datacentral.py)
OFFLINE_FLAG = "--offline"
OUTPUT = "_output"
all: build
build:
if [ -d .env ]; then . `pwd`/.env/bin/activate; fi; \
python $(MAIN_SCRIPT)
build-offline:
if [ -d .env ]; then . `pwd`/.env/bin/activate; fi; \
python $(MAIN_SCRIPT) $(OFFLINE_FLAG)
install:
if ! [ -x "$(pyvenv -h)" ]; then virtualenv .env --no-site-packages --distribute --prompt=\(datacentral\); else pyvenv .env; fi
. `pwd`/.env/bin/activate; pip install -r requirements.txt
if [ ! -f settings.conf ]; then cp settings.conf.sample settings.conf; fi
serve:
if [ -d .env ]; then . `pwd`/.env/bin/activate; fi; \
livereload -p $(SERVER_PORT) $(OUTPUT)
deploy:
rsync --checksum --compress --progress --recursive --delete $(OUTPUT)/ $(SSH_PATH)
deploy-dry:
rsync --dry-run --checksum --compress --progress --recursive --delete $(OUTPUT)/ $(SSH_PATH)
clean:
rm -fr repos $(OUTPUT)
test:
if [ -d .env ]; then . `pwd`/.env/bin/activate; fi; \
nosetests tests.py