forked from 4teamwork/ftw-buildouts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-robot-varnish.cfg
67 lines (54 loc) · 2.02 KB
/
test-robot-varnish.cfg
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
# Sets up a varnish for testing with robot framework.
# This is only required when varnish is needed.
# The default test-plone-*.cfgs work perfectly without this.
# Be sure to load test-robot-varnish.cfg *after* test-plone-*.cfg.
#
# Those ports will be used when they are available as environment variables:
# ZSERVER_PORT - on this port zope will listen
# PORT1 - will be used by supervisor
# PORT2 - will be used by varnishd
# PORT3 - varnish will listen on this port, so we connect with the browser here
#
[buildout]
parts +=
ports
varnish-build
varnish
varnish-conf
supervisor
[ports]
recipe = collective.recipe.shelloutput
commands =
plone_public = if [[ "$PORT3" -ne "" ]]; then echo "$PORT3"; else echo "8080"; fi
zserver = if [[ "$ZSERVER_PORT" -ne "" ]]; then echo "$ZSERVER_PORT"; else echo "8081"; fi
supervisor = if [[ "$PORT1" -ne "" ]]; then echo "$PORT1"; else echo "8082"; fi
varnish = if [[ "$PORT2" -ne "" ]]; then echo "$PORT2"; else echo "8083"; fi
[test-jenkins]
pre-test +=
export ZSERVER_PORT=${ports:zserver}
export PLONE_TESTING_PORT=${ports:plone_public}
${buildout:directory}/bin/supervisord || exit $?
post-test += ${buildout:directory}/bin/supervisorctl shutdown || exit $?
[varnish-build]
recipe = zc.recipe.cmmi
url = ${varnish:download-url}
[varnish]
recipe = plone.recipe.varnish:instance
bind = 0.0.0.0:${ports:plone_public}
cache-size = 256M
mode = foreground
daemon = ${buildout:parts-directory}/varnish-build/sbin/varnishd
config = ${buildout:directory}/etc/varnish.vcl
[varnish-conf]
recipe = collective.recipe.template
url = https://raw.github.com/plone/plone.act/master/templates/varnish.vcl.in
output = ${buildout:directory}/etc/varnish.vcl
backend = 127.0.0.1
backend_port = ${ports:zserver}
[supervisor]
recipe = collective.recipe.supervisor
port = ${ports:supervisor}
user = admin
password = admin
programs =
10 varnish ${varnish:daemon} [ -f ${varnish:config} -n ${buildout:directory}/var -s malloc,1G -a 0.0.0.0:${ports:plone_public} -F ] ${buildout:directory}