-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
109 lines (78 loc) · 2.5 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
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/make
#
pybot_options =
.PHONY: instance cleanall test robot stop coverage
PACKAGE_ROOT = src/collective/jekyll
BUILDOUT_VERSION = 2.11.5
SETUPTOOLS_VERSION = 39.2.0
GS_FILES = $(PACKAGE_ROOT)/profiles/*/*.xml $(PACKAGE_ROOT)/setuphandlers.py
BUILDOUT_COMMAND = ./bin/buildout -Nt 5
all: instance
BUILDOUT_FILES = buildout.cfg varnish.cfg setup.py bin/buildout
ifneq ($(strip $(TRAVIS)),)
IS_TRAVIS = yes
endif
ifdef IS_TRAVIS
# use specific buildout that depends on cache
buildout.cfg: travis.cfg
cp travis.cfg buildout.cfg
# use python as Travis has setup the virtualenv
bin/buildout: bootstrap-buildout.py buildout.cfg
mkdir -p buildout-cache/downloads
python bootstrap-buildout.py --version=$(BUILDOUT_VERSION) --setuptools-version=$(SETUPTOOLS_VERSION)
touch $@
bin/buildout install download install
else
# make a virtualenv
bin/python:
virtualenv-2.7 --no-site-packages .
touch $@
buildout.cfg:
cp dev.cfg buildout.cfg
bin/buildout: bin/python bootstrap-buildout.py buildout.cfg
./bin/python bootstrap-buildout.py --version=$(BUILDOUT_VERSION) --setuptools-version=$(SETUPTOOLS_VERSION)
touch $@
endif
bin/test: $(BUILDOUT_FILES) bin/supervisord
$(BUILDOUT_COMMAND) install test test-wrap-varnish
touch $@
bin/coverage-test: $(BUILDOUT_FILES)
$(BUILDOUT_COMMAND) install coverage-test
touch $@
bin/coveragereport: $(BUILDOUT_FILES)
$(BUILDOUT_COMMAND) install coverage-report
touch $@
parts/instance: $(BUILDOUT_FILES)
$(BUILDOUT_COMMAND) install instance
touch $@
bin/instance: parts/instance
if [ -f var/plonesite ]; then rm var/plonesite; fi
touch $@
var/plonesite: $(GS_FILES) bin/instance
$(BUILDOUT_COMMAND) install plonesite
touch $@
instance: var/plonesite
bin/instance fg
cleanall:
if [ -f var/supervisord.pid ]; then bin/supervisorctl shutdown; sleep 5; fi
rm -fr bin develop-eggs downloads eggs parts .installed.cfg
test: bin/test
zope_i18n_compile_mo_files=true ./bin/test
bin/robot: $(BUILDOUT_FILES)
$(BUILDOUT_COMMAND) install robot
touch $@
bin/supervisord: $(BUILDOUT_FILES)
$(BUILDOUT_COMMAND) install varnish-build varnish-conf varnish supervisor
touch $@
bin/supervisorctl: bin/supervisord
touch $@
var/supervisord.pid: bin/supervisord bin/supervisorctl
if [ -f var/supervisord.pid ]; then bin/supervisorctl shutdown; sleep 5; fi
bin/supervisord --pidfile=$@
robot: bin/pybot var/supervisord.pid
bin/robot $(pybot_options) -d robot-output
stop:
bin/supervisorctl shutdown
coverage: bin/coverage-test bin/coveragereport
bin/coverage-test
bin/coveragereport