I'm trying to achieve a repeatable deployment of Plone for a site, and using buildout, basically following Martin Aspeli's book Professional Plone 4 Development. I can set up the system with my source products <site>.policy
and <site>.theme
, and have activated the theme automatically, but when I run buildout, I still have to instantiate a Plone site and activate the policy product, before creating the standard objects for the site.
Can buildout check for the existence of content objects like the Plone site object or particular folders during setup, and create them if they don't exist with the right settings? Can I do that in a separate <site>.content
product, or should this be handled in the <site>.policy
?
In principle buildout can do anything you can code, as long as you create a recipe to do the thing for you.
Luckily, someone already created a recipe to create the plone site for you, called
collective.recipe.plonesite
:The recipe provides several hooks that let you control site creation, and execute system commands before or after the site is created or extra python code before or after GS profiles are run.
In the above example
post-extras
runs acreate_content.py
script with the variablesapp
andsite
set: