Friday, February 19, 2010

A Plone 4 buildout setup

A set of buildout files for Plone 4. My goal is to cover the entire project. from a development setup to production.

buildout-base.cfg



Define here everything you want to have in your portal that is not in standard Plone.


[buildout]
extends =
buildout-plone.cfg
# ...

[instance]
eggs +=
# ...
# eggs for your site



buildout-plone.cfg



A default Plone buildout. This one was created with paster create -t plone3_buildout and uses Plone 4.0a4.


[buildout]
parts =
productdistros
instance
zopepy

# Change the number here to change the version of Plone being used
extends =
http://download.zope.org/Zope2/index/2.12.3/versions.cfg
http://dist.plone.org/release/4.0a4/versions.cfg
versions = versions


# Add additional egg download sources here. dist.plone.org contains archives
# of Plone packages.
find-links =
http://dist.plone.org/release/4.0a4
http://dist.plone.org/thirdparty

# Add additional eggs here
eggs =

# Reference any eggs you are developing here, one per line
# e.g.: develop = src/my.package
develop =





# Use this section to download additional old-style products.
# List any number of URLs for product tarballs under URLs (separate
# with whitespace, or break over several lines, with subsequent lines
# indented). If any archives contain several products inside a top-level
# directory, list the archive file name (i.e. the last part of the URL,
# normally with a .tar.gz suffix or similar) under 'nested-packages'.
# If any archives extract to a product directory with a version suffix, list
# the archive name under 'version-suffix-packages'.
[productdistros]
# For more information on this step and configuration options see:
# http://pypi.python.org/pypi/plone.recipe.distros
recipe = plone.recipe.distros
urls =
nested-packages =
version-suffix-packages =

[instance]
# For more information on this step and configuration options see:
# http://pypi.python.org/pypi/plone.recipe.zope2instance
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
#debug-mode = on
#verbose-security = on
blob-storage = var/blobstorage
# If you want Zope to know about any additional eggs, list them here.
# This should include any development eggs you listed in develop-eggs above,
# e.g. eggs = Plone my.package
eggs =
Zope2
Plone
${buildout:eggs}

# If you want to register ZCML slugs for any packages, list them here.
# e.g. zcml = my.package my.other.package
zcml =

products =
${buildout:directory}/products
${productdistros:location}

[zopepy]
# For more information on this step and configuration options see:
# http://pypi.python.org/pypi/zc.recipe.egg
recipe = zc.recipe.egg
eggs = ${instance:eggs}
interpreter = zopepy
scripts = zopepy


buildout-dvl.cfg



A buildout for local development. This uses mr.developer to develop eggs, and adds dev products (such as plone.reload), testrunner and omelette.


[buildout]
extends =
buildout-base.cfg

extensions = mr.developer
sources = sources
auto-checkout +=
# ...
parts +=
test
omelette
unzip = true

[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}
packages = ${instance:location}/lib/python ./

[sources]
# ...

[instance]
debug-mode = on
verbose-security = on
eggs +=
plone.reload
Products.Clouseau

[test]
recipe = zc.recipe.testrunner
eggs =
${instance:eggs}



buildout-tst.cfg



The test server (as in testing / acceptance / production). This adds zeo config to buildout-dvl.cfg. (My tst/acc/prd setup consists of two machines, each of them runs one client.)

The zeo settings are read from another file, to keep passwords out of version control.


[buildout]
extends =
buildout-dvl.cfg
zeo.cfg
test-settings.cfg




zeo.cfg



Turns a single instance buildout into a zeo server-client setup.


[buildout]
extends = buildout-base.cfg

parts +=
zeoserver
client1

[zeoserver]
recipe = plone.recipe.zeoserver

[client1]
recipe = plone.recipe.zope2instance
debug-mode = ${instance:debug-mode}
verbose-security = ${instance:verbose-security}
eggs = ${instance:eggs}
zcml = ${instance:zcml}
products = ${instance:products}
zeo-client = on
# Note: Do not set shared-blob = on with multiple machines.


test-settings.cfg



An example for the settings required by buildout-tst.cfg.


[zeoserver]
zeo-address = 18105
file-storage = /ha-data/APPS/viva/tst/filestorage/Data.fs
# use full path for blob-storage
blob-storage = /ha-data/APPS/viva/tst/blobstorage

[client1]
user = admin:secret
http-address = 8085
zeo-address = x.x.x.x:18085



buildout-dvl-zeo.cfg



A local development buildout which uses zeo setup with two clients.


[buildout]
extends = buildout-dvl.cfg

parts +=
zeoserver
client1
client2

[zeoserver]
recipe = plone.recipe.zeoserver
zeo-address = 8100

[client1]
recipe = plone.recipe.zope2instance
user = ${instance:user}
debug-mode = ${instance:debug-mode}
verbose-security = ${instance:verbose-security}
eggs = ${instance:eggs}
zcml = ${instance:zcml}
products = ${instance:products}
zeo-client = on
zeo-address = ${zeoserver:zeo-address}
http-address = 8080

[client2]
<= client1
http-address = 8081

No comments: