更新plone站点的构建方法

collective.recipe.updateplone的Python项目详细描述


Problem

执行完构建以部署plone项目后,必须开始 zope实例,然后在zmi上创建/更新plone站点, 安装/重新安装一些产品,运行一些GS配置文件,有时运行一些 脚本或迁移到新的plone版本。这太无聊了!

Solution

collective.recipe.updateplone是一个可用于创建 或者更新plone站点。它自动执行以下任务:

  • Backup database
  • pack database
  • create plone sites if it do not exist
  • install or reinstall products with the quickinstaller
  • uninstall products with the quickinstaller
  • run GS profiles
  • run Plone migration (portal_migration.upgrade)

Supported options

配方支持以下选项:

plone站点
>一个PLAN站点的列表,用于更新或创建它们。 列表中的每一项都由zope实例名组成,其中包含 (将包含)plone站点、一个点和plone站点的名称。 例如:instance1.site1
迁移plone
如果为真,配方将通过运行 门户_migration.upgrade()。只有在迁移到 新版本的plone。此选项默认为false。
卸载
要用quickinstaller卸载的包/产品的列表 已安装
安装
要与quickinstaller一起安装或 如果已经安装,请重新安装。
运行脚本
要调用/运行的脚本列表。列表中的每一项都包含到 要运行的脚本。路径必须以portal/开头。 例如:门户/迁移全部
运行配置文件
要运行的GS配置文件ID列表。每一个身份证都必须按其接受的方式提供 通过设置工具。IE:Profile产品名称:默认值
备份数据库
如果为true,则配方将在处理之前备份data.fs。默认为false。
包分贝
如果为true,则配方将在处理之前打包data.fs。默认为false
管理员姓名
zope实例管理的名称。与^{tt3}中定义的相同$ Zope实例的选项。默认为“管理员”
运行一次
如果为真,则配方只运行一次。如果你在大楼里跑了很多次 配方只在第一次运行。它通过将文件写入 var目录。如果你想再次运行配方,你必须删除 var目录中的文件或将此选项设置为false。文件名 与扩展名为cfg的节名相同。此选项默认 为真。

Example usage

我们将从创建使用配方的构建开始。让我们创造 一个freash zope实例并在其中创建两个plone站点。我们也会 将richtocument和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 =
... """)

运行构建会给我们带来:

>>> 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>

Contributors

  • 安东·斯托诺,作者
  • Mustapha Benali,作者
  • Danilo G.Botelho,撰稿人
  • Sidnei da Silva,撰稿人

0.3 (2009-02-07)

  • Fixed recipe to correctly work on paths containing spaces on Windows. [sidnei]
  • Fixed recipe to locate the ZEO Service script correctly on Windows. [sidnei]
  • Use newer API for running GenericSetup profiles, if it’s available. [sidnei]

0.2 (2009-02-01)

  • Fixed recipe to correctly run instance executable on Windows [danilogbotelho]

0.1 (2008-07-22)

  • Created recipe with ZopeSkel [Mustapha Benali].
  • Fixed recipe to correctly run instance executable on Windows [Danilo G. Botelho].

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java中char的用途   swing修复,以便显示可以同时显示十进制数和整数   java给定一个场景,找到拥有的JFXPanel   java JPA 2标准获取路径导航   java如何用JUnit测试这个类?   JSF中的java请求作用域   Spring云Zuul代理背后的java Spring OAuth授权服务器   java限制聚合返回的存储桶大小   java如何在安卓应用程序中请求超级su权限   防止超级关键字的java Checkstyle规则   java 安卓。应用程序。应用程序无法强制转换到安卓。应用程序。在回收器适配器中使用FragmentManager时的活动   使用Java的Twitter广告API   切换到4.0.1版本后,java“JavaMailSenderImpl无法解析为类型”   java没有getter方法可用于名称下bean的属性   java 0/1背包堆空间   java我无法使用断点进行调试   Jar文件名表单java代码   java调用从扩展活动的MainActivity类扩展片段的类片段