用于更新plone站点的buildout配方
项目描述
问题
在执行 buildout 以部署您的 Plone 项目后,您必须启动 zope 实例,然后转到 ZMI 创建/更新 plone 网站,安装/重新安装某些产品,运行一些 GS 配置文件,或者有时运行一些脚本或迁移到新的 Plone 版本。这很无聊!
解决方案
collective.recipe.updateplone 是一个 buildout 配方,您可以使用它来创建或更新 plone 网站。它自动执行以下任务:
备份数据库
打包数据库
如果不存在,则创建 plone 网站
使用快速安装程序安装或重新安装产品
使用快速安装程序卸载产品
运行 GS 配置文件
运行 Plone 迁移(portal_migration.upgrade)
详细文档
支持选项
该配方支持以下选项:
- plone-site
要更新或创建(如果不存在)的 plone 网站列表。列表中的每一项由包含(将包含)plone 网站的 zope 实例名称、一个点和 plone 网站名称组成。例如:instance1.site1
- migrate-plone
如果为真,配方将通过运行 portal_migration.upgrade() 升级您的 plone 网站。如果您正在迁移到 Plone 的新版本,则此选项很有用。此选项默认为 false。
- uninstall
要使用快速安装程序卸载的包/产品列表(如果已安装)
- install
要使用快速安装程序安装的包/产品列表,如果已安装则重新安装。
- run-script
要调用/运行的脚本列表。列表中的每一项由要运行的脚本的路径组成。路径必须以 portal/ 开头。例如:portal/migrate_all
- run-profile
要运行的 GS 配置文件 ID 列表。每个 ID 必须以与 setup 工具接受的格式给出。例如:profile-ProductName:default
- backup-db
如果为真,配方将在处理之前备份 Data.fs。默认为 false。
- pack-db
如果为真,配方将在处理之前打包 Data.fs。默认为 false。
- admin-name
zope 实例管理员的名称。与 zope 实例的 user 选项中定义的相同。默认为 'admin'。
- run-once
如果为真,配方将只运行一次。如果您多次运行 buildout,配方将只运行第一次。它是通过在 var 目录中写入文件来完成的。如果您想再次运行配方,您必须从 var 目录中删除该文件或将此选项设置为 false。文件名与部分名称相同,扩展名为 cfg。此选项默认为 True。
示例用法
让我们从创建一个使用该配方的 buildout 开始。让我们创建一个全新的 zope 实例,并在其中创建 2 个 plone 网站。我们还将将这些网站中的 RichDocument 和 NuPlone 安装到这些网站中。
>>> write(sample_buildout, 'buildout.cfg', """ ... [buildout] ... parts = ... zope2 ... instance1 ... plone ... update-plone ... index = http://pypi.python.org/simple ... find-links = ... http://download.zope.org/distribution/ ... http://effbot.org/downloads ... eggs = ... elementtree ... PILwoTK ... ... [zope2] ... recipe = plone.recipe.zope2install ... url = ${plone:zope2-url} ... ... [plone] ... recipe = plone.recipe.plone ... ... [instance1] ... recipe = plone.recipe.zope2instance ... zope2-location = ${zope2:location} ... user = admin:admin ... deprecation-warnings = false ... eggs = ... ${buildout:eggs} ... ${plone:eggs} ... Products.RichDocument ... zcml = ... Products.RichDocument ... products = ... ${plone:products} ... ... [update-plone] ... recipe = collective.recipe.updateplone ... backup-db = true ... pack-db = true ... plone-site = ... instance1.site1 ... instance1.site2 ... install = ... Marshall ... uninstall = ... run-profile = ... profile-Products.RichDocument:default ... profile-Products.NuPlone:nuplone ... run-script = ... """)
运行 buildout 给我们
>>> print system(buildout) # doctest:+ELLIPSIS Getting distribution for 'plone.recipe.plone'. ... Installing update-plone. *** collective.recipe.updateplone: Starting to pack Database... *** collective.recipe.updateplone: Database packed... *** collective.recipe.updateplone: Adding plone site: site1 *** collective.recipe.updateplone: Added plone site: site1 *** collective.recipe.updateplone: Adding plone site: site2 *** collective.recipe.updateplone: Added plone site: site2 *** collective.recipe.updateplone: site1->Nothing to uninstall *** collective.recipe.updateplone: site1->Installing: ['Marshall'] *** collective.recipe.updateplone: site1->Installed: ['Marshall'] *** collective.recipe.updateplone: site1->Running profile profile-Products.RichDocument:default *** collective.recipe.updateplone: site1->Ran profile profile-Products.RichDocument:default *** collective.recipe.updateplone: site1->Running profile profile-Products.NuPlone:nuplone *** collective.recipe.updateplone: site1->Ran profile profile-Products.NuPlone:nuplone *** collective.recipe.updateplone: site2->Nothing to uninstall *** collective.recipe.updateplone: site2->Installing: ['Marshall'] *** collective.recipe.updateplone: site2->Installed: ['Marshall'] *** collective.recipe.updateplone: site2->Running profile profile-Products.RichDocument:default *** collective.recipe.updateplone: site2->Ran profile profile-Products.RichDocument:default *** collective.recipe.updateplone: site2->Running profile profile-Products.NuPlone:nuplone *** collective.recipe.updateplone: site2->Ran profile profile-Products.NuPlone:nuplone ... <BLANKLINE>
贡献者
Anton Stonor,作者
Mustapha Benali,作者
Danilo G. Botelho,贡献者
Sidnei da Silva,贡献者
变更历史
0.3 (2009-02-07)
修复了在包含空格的路径上正确工作的配方。[sidnei]
修复了在 Windows 上正确定位 ZEO 服务脚本的配方。[sidnei]
使用可用的最新 API 运行 GenericSetup 配置文件。[sidnei]
0.2 (2009-02-01)
修复了在 Windows 上正确运行实例可执行文件的配方 [danilogbotelho]。
0.1 (2008-07-22)
使用 ZopeSkel 创建了配方 [Mustapha Benali]。
修复了在 Windows 上正确运行实例可执行文件的配方 [Danilo G. Botelho]。
下载
项目详情
collective.recipe.updateplone-0.3.tar.gz 的散列值
算法 | 散列摘要 | |
---|---|---|
SHA256 | d08d1aaed675d9826d7fb4bf5f5c12f2ad1d794df2772eb0711d77bd23aeced7 |
|
MD5 | c203e7a616a411010c99272ae5d95061 |
|
BLAKE2b-256 | 9fc0e5182633e27a8e3a8e86c38a31139ce44c1c1271a417585d73621074d2c6 |