Package: collective.recipe.plonesite
IntroductionThis recipe enables you to create and update a Plone site as part of a
buildout run. This recipe only aims to run profiles and Quickinstall
products. It is assumed that the install methods, setuphandlers, upgrade
steps, and other recipes will handle the rest of the work.ContentsIntroductionDetailed DocumentationOptionsGeneral SettingsLoggingInstall ProductsRun ScriptsUpgradingVHM (VirtualHostMonster)ExampleExample with Plone 4 content enabledExample with Multiple Mount PointsContributorsChange history1.12.0 (2021-03-06)1.11.0 (2019-03-20)1.10.0 (2019-03-20)1.9.5 (2016-06-22)1.9.4 (2016-01-20)1.9.3 (2016-01-15)1.9.2 (2015-06-22)1.9.1 (2014-12-01)1.9.0 (2014-08-29)1.8.2 (2013-04-08)1.8.1 (2012-11-16)1.8.0 (2012-11-16)1.7.3 (2012-11-02)1.7.2 (2012-08-06)1.7.1 (2012-07-13)1.6.3 (2012-07-03)1.6.1 (2012-06-27)1.6 (2012-06-26)1.5 (2011-09-22)1.4.3 (2011-07-07)1.4.2 (2011-07-07)1.4.1 (2011-02-15)1.4 (2011-02-15)1.3 (2010-02-11)1.2 (2010-02-10)1.1 (2009-11-10)1.0 (2009-08-24)0.9 (2009-08-10)0.8 (2009-06-24)0.7 (2009-06-23)0.6 (2008-12-16)0.5 (2008-11-11)0.4 (2008-11-11)0.3 (2008-10-30)0.2 (2008-10-30)0.1 (2008-10-11)DownloadCode repository:https://github.com/collective/collective.recipe.plonesiteReport bugs athttps://github.com/collective/collective.recipe.plonesite/issuesDetailed DocumentationOptionsGeneral Settingssite-idThe id of the Plone site that the script will create. This will
also be used to update the site once created. Default: Ploneadmin-userThe id of an admin user that will be used as theManager.
Default:adminadmin-passwordThe password for the admin user. This is only needed when theuse_vhmoption is set and the root object of the site is not accessible byAnonymous.instanceThe name of the instance that will run the script.
Default: instancezeoserverThe name of thezeoserverpart that should be used. This is
only required if you are using a zope/zeo setup. Default: not setcontainer-pathThe path (relative from Zope root) to the container that should hold the
Plone site.
Default:/default-languageThe default language of the Plone site.
Default:enuse-sudoRun the task under a different user, as specified in the
appropriate instance’s buildout section. You need to configure
sudo appropriately.add-mountpointAdds the ZODB Mount Point at the path specified bycontainer-path, if
it doesn’t exist. Very handy when used in conjunction with
collective.recipe.filestorage.LoggingThis recipe honors thelog-levelbuildout-level config value, and theverbositysetting, overriding the running Zope instance’seventloglevel. This allows you to get more logging output when running the part,
but have less verbosity when the site is actually running.Install ProductsDEPRECATION NOTICE: Installing products in Plone 6 is deprecated since it no longer has Quickinstaller: use profiles instead.products-initialA list of products to quick install just after initial site
creation. See above for information about the product name
format[2].profiles-initialA list of GenericSetup profiles to run just after initial site
creation. See above for information on the expected profile id
format[1].productsA list of products to quick install each time buildout is run. See
above for information about the product name format[2].profilesA list of GenericSetup profiles to run each time buildout is run.
See above for information on the expected profile id format[1].[1](1,2,3)Profiles have the following format:<package_name>:<profile>(e.g.my.package:default). The profile can also be prepended
with theprofile-if you so choose
(e.g.profile-my.package:default).[2](1,2)The product name is typicallynotthe package name such asProducts.MyProduct, but just the product nameMyProduct.
Quickest way to find out the name that is expected is to
‘inspect’ the Quickinstaller page and see what value it is
passing in.Run Scriptspre-extrasAn absolute path to a file with python code that will be evaluated
before running Quickinstaller and GenericSetup profiles. Multiple
files can be given. Two variables will be available to you. The app
variable is the Zope root. The portal variable is the plone site as
defined by the site-id option. NOTE: file path cannot contain
spaces. Default: not setpost-extrasAn absolute path to a file with python code that will be evaluated
after running Quickinstaller and GenericSetup profiles. Multiple
files can be given. Two variables will be available to you. The app
variable is the Zope root. The portal variable is the plone site as
defined by the site-id option. NOTE: file path cannot contain
spaces. Default: not setbefore-installA system command to execute before installing Plone. You could use
this to start a Supervisor daemon to launch ZEO, instead of
launching ZEO directly. You can use this option in place of the
zeoserver option. Default: not setafter-installA system command to execute after installing Plone.
Default: not setUpgradingupgrade-portalUpgrade the site to the current version on the filesystem by
running all upgrade steps for the site’s base GenericSetup
profile.  Requirescollective.upgradebe installed.  Default: falseupgrade-all-profilesUpgrade all GenericSetup profiles installed in the site to their current
versions on the filesystem by running all their upgrade steps.  Requirescollective.upgradebe installed. Default: falseupgrade-profilesA list of GenericSetup profiles to run upgrade steps for each time buildout
is run. Upgrades are run afterprofiles-initialand beforeprofiles. See above for information on the expected profile id format[1].  Requirescollective.upgradebe installed.site-replaceReplace any existing plone site namedsite-id. Default: falseenabledOption to start up the instance/zeoserver. Default: true. This can
be a useful option from the command line if you do not want to
start up Zope, but still want to run the complete buildout.$ bin/buildout -Nv plonesite:enabled=falseVHM (VirtualHostMonster)hostA hostname used in VirtualHostMonster traversal.  This will set the
root URL for theportalvariable in anypre-extrasorpost-extrasscripts. Default: not setprotocolEither ‘http’ or ‘https’ for a VirtualHostMonster path. Requires the
host option be set. Default: httpportPort for the Zope site used in a VirtualHostMonster path. Requires the
host option be set. Default: 80use-vhmSignals whether Plone site should use VirtualHostMonster or ordinary
Zope traversal when generating a request. Useful for setting up instances
that will not be proxied behind Apache or Nginx, such as local development.
Default: TrueExampleHere is an example buildout.cfg with the plonesite recipe:[buildout]
parts =
    zope2
    instance
    zeoserver
    plonesite

[zope2]
recipe = plone.recipe.zope2install
...

[instance]
recipe = plone.recipe.zope2instance
...
eggs =
    ...
    my.package
    my.other.package

zcml =
    ...
    my.package
    my.other.package

[zeoserver]
recipe = plone.recipe.zope2zeoserver
...

[plonesite]
recipe = collective.recipe.plonesite
site-id = test
instance = instance
zeoserver = zeoserver
# A profile with proper upgrade steps
profiles-initial = addon.package:default
profiles =
# A profile not using upgrade steps, such as a simple policy package
    my.package:default
upgrade-portal = True
upgrade-all-profiles = True
post-extras =
    ${buildout:directory}/my_script.py
pre-extras =
    ${buildout:directory}/my_other_script.py
host = www.mysite.com
protocol = https
port = 443Example with Plone 4 content enabledHere is another example buildout.cfg with the plone4site recipe:[buildout]
parts =
    ...
    plone4site

[plone4site]
recipe = collective.recipe.plonesite
site-id = test
instance = instance
zeoserver = zeoserver
# Create default plone content like News, Events...
profiles-initial =
    Products.CMFPlone:plone-content
    my.package:initial
profiles =
    my.package:default
    my.other.package:defaultExample with Multiple Mount PointsThis uses collective.recipe.filestorage to create the mount point configuration:[buildout]
parts =
    filestorage
    instance
    zeoserver
    plonesite1
    plonesite2

[filestorage]
recipe = collective.recipe.filestorage
parts =
    mp1
    mp2

[instance]
recipe = plone.recipe.zope2instance
...
eggs =
    ...
    my.package
    my.other.package

zcml =
    ...
    my.package
    my.other.package

[zeoserver]
recipe = plone.recipe.zope2zeoserver
...

[plonesite1]
recipe = collective.recipe.plonesite
add-mountpoint = true
container-path = /mp1
profiles-initial = Products.CMFPlone:plone-content
site-id = portal

[plonesite2]
recipe = collective.recipe.plonesite
add-mountpoint = true
container-path = /mp2
profiles-initial = Products.CMFPlone:plone-content
site-id = portalContributorsClayton Parker [claytron], AuthorAndrew Burkhalter [andrewb]JeanMichel FRANCOIS [toutpt]Andreas Jung [ajung]Jeff Kowalczyk [jeffk]Pelle Krogholt [pelle]Michael Davis [davismr]Nolan Brubaker [nrb]David Blewett [davidblewett]Toni Mueller [muellert]Fabio Rauber [fabiorauber]Bryan Wilson [bryanlandia]Chrissy Wainwright [cdw9]Victor Fernandez de Alba [sneridagh]Change history1.12.0 (2021-03-06)Add compatibility with Plone 6
[sneridagh]1.11.0 (2019-03-20)Fix brownbag release
[sneridagh]1.10.0 (2019-03-20)Python3 compatibility
[sneridagh]1.9.5 (2016-06-22)for GenericSetup 1.8.0+ set runAllImportStepsFromProfile to reapply
the dependency profiles. This will keep our buildouts running as
previously expected, with the profiles listed in the policy’s metadata.xml
being run every time
[cdw9]1.9.4 (2016-01-20)Nothing new, but pypi was having issues with 1.9.31.9.3 (2016-01-15)Plone 5 compatibility
[santonelli]1.9.2 (2015-06-22)Only use valid Python logging levels. Round up to the closest level
if the passed in value does not exist.
[claytron]1.9.1 (2014-12-01)Add ability touse_vhmwhen the homepage is not accessible byAnonymousby setting theadmin-passwordoption.
[claytron]PEP8 and pyflakes
[claytron]Restore Python 2.4 compatibility
[bryanlandia]Plone 5 compat, re-use add site form default profile logic.
[@rpatterson]1.9.0 (2014-08-29)Add theadd-mountpointoption to automatically create the mount-point if
it does not exist.
[fabiorauber]Add options for running profile upgrade steps ifcollective.upgradeis
installed.
[@rpatterson]Add an option to allow the use of sudo, if you have specified different UIDs for
Zope and the ZEO server.
[muellert]Clean up the docs and separate the options by headers.
[claytron]1.8.2 (2013-04-08)HandlesetSiteimport for Plone 4.3
[claytron]1.8.1 (2012-11-16)Add changelog entry for 1.8.90
[nrb]1.8.0 (2012-11-16)Add theuse-vhmoption to select traversal mode.
Settinguse-vhmtoFalsewill cause the traversal to use
regular Zope traversal when running the recipe.
[nrb]1.7.3 (2012-11-02)Use_delObject(site_id, suppress_events=True)to delete the site.
This ignores all events and just removes the site completely when
using thesite-replaceoption.
[claytron]1.7.2 (2012-08-06)Fixed typo on logger when removing existing Plone site.
[hvelarde]1.7.1 (2012-07-13)Add support for changing the logging level used when the part runs,
honoring the buildout log-level and verbosity. [davidblewett]Update version check to correctly differentiate between Plone 4.1.x
and Plone 4.0 and below. [davidblewett]1.6.3 (2012-07-03)Update VirtualHostMonster support to correct loss of elevated security
context. [davidblewett]1.6.1 (2012-06-27)Fix reST formatting. [nrb]Correct some doc oversights. [nrb]1.6 (2012-06-26)Add VirtualHostMonster path support for the ‘portal’ variable
available inpre-extrasandpost-extrasscripts. [nrb]hostrecipe option specifices a hostname to be used in
a VirtualHostMonster path for extra recipe scripts. [nrb]portrecipe option specifies a port to be used in a
VirtualHostMonster path for extra recipe scripts. [nrb]protocolrecipe option specifies a protocol to be used in
a VirtualHostMonster path from extra recipe scripts. [nrb]Fixed typo in documentation.
[hvelarde]container-pathrecipe option specifies the path to the
container where the Plone site will be added.
[gotcha]default-languagerecipe option specifies the default language
of the Plone site.
[sgeulette]1.5 (2011-09-22)Support forzope.globalrequest.
[gotcha]Support Plone 4.1
[gotcha]1.4.3 (2011-07-07)Minor doc updates.
[claytron]1.4.2 (2011-07-07)Released to plone.org
[claytron]Doc updates.
[claytron]1.4.1 (2011-02-15)Minor doc updates
[claytron]1.4 (2011-02-15)PEP8 cleanup
[claytron]Handle new zeoserver recipe on windows which changes the name of the
executable.
[claytron]Use theplonevariable notportalotherwiseplonesite.pyraisesNameError: global name 'portal' is not definedon a new install.
[pelle]Enable GS profiles to work in plone 2.5
[davismr]UsesetSitein the initial creation as well.
[claytron]1.3 (2010-02-11)UsesetSitein theplonesite`.py`script so that the component architecture gets initialized properly. This will allow the installation of a product like ``plone.app.dexterity[clayton]1.2 (2010-02-10)Update docs with info about how to add aProduct[claytron]Adjusted the support for Plone4 since theaddPloneSite()has
changed slightly.
[pelle]1.1 (2009-11-10)Make sure to commit the transaction after adding the plone site to
avoid some strange behavior.
[claytron]Add support for Plone4
[toutpt]1.0 (2009-08-24)Added abefore-installandafter-installoption to the recipe. this
allows you to use something like supervisor to launch the processes.
Thanks to Shane Hathaway for the patch.
[claytron]0.9 (2009-08-10)Fixed thesite-idoption so that it defaults toPloneproperly.
Thanks to aclark for the bug report.
[claytron]0.8 (2009-06-24)Subversion 1.6 and setuptools are not friends yet. Fixed upload.
[claytron]0.7 (2009-06-23)Clarification to docs.  Cleaning up copy/paste error to post-extras
[andrewb]Fixed theinstanceoption so that it defaults toinstanceproperly
[claytron]0.6 (2008-12-16)Makeadmin-userconfiguration option truly optional per the documentation.
Fallback toadminwhich would be the common default per ZopeSkel’s
plone3_buildout template
[andrewb]Added new optionspre-extrasandpost-extras.  The two options are files that
can be run before and after the quickinstaller and profiles have been run.
[claytron]Add condition so that the script can be used on older versions of plone
[claytron]0.5 (2008-11-11)Fixed a bug where already installed Products would not be re-installed
[claytron]Added example buildout config and updated the READMEs
[claytron]Re-factored theplonesite.pyscript
[claytron]A dash of PEP 8
[claytron]0.4 (2008-11-11)Added aenabledoption so that you can switch the part
off from the command line. (buildout:parts-=plonesitedoesn’t
work yet)
[claytron]Change the script so that profiles prefixed withprofile-can
also be given.
[claytron]Added some docs to the recipe
[claytron]0.3 (2008-10-30)Addedsite-replaceoption to the readme
[claytron]Thesite-replaceoption is no longer required
[claytron]0.2 (2008-10-30)new Plone sites will be created with a datetime suffix
which is helpful if you need to re-run new instances
over and over again e.g. for migration purposes. If you
need a fixed site id then explictely set the id using
thesite-idoption.
[ajung]Fixed error with uninitialized variable
[jeffk]Add buildout recipe option site-replace, defaults to
off. Use withsite-id.New recipe optionsite-replace= onwill remove any
existing object in app namedsite-id. A new plone site
will be created to replace it.Default option settingsite-replace= offwill not remove
existing objects in app named site-id.
[jeffk]0.1 (2008-10-11)Created recipe with ZopeSkel
[claytron]Download