“实例”使用构建部分扩展切换到 2 个 Plone 实例时,构建不会删除该部分

发布于 2025-01-01 08:22:47 字数 1119 浏览 0 评论 0原文

我们正在将我们的产品 Plone 部署从一个 Zope 实例切换为两个 Zope 实例。我定义了以下构建结构:

buildout.cfg

[buildout]
extends = app.cfg
... some environment specific stuff

app.cfg

[buildout]
extends = base.cfg

parts =
    zope2
    productdistros
    instance1
    instance2
    zopepy
    supervisor

[instance1]
<= instance
http-address = 18081

[instance2]
<= instance
http-address = 18082

base.cg

[buildout]
parts =
    zope2
    productdistros
    instance
    zopepy

... bulk of buildout configuration suitable for both server and development

对此进行测试我希望此构建配置会导致现有实例部分被删除并替换为实例1 和实例2。但是实例部分并未被删除 - 它仍然可以在 bin 和 parts 目录中找到。

[zopetest@dev home]$ bin/buildout
Updating zope2.
Updating fake eggs
Updating productdistros.
Updating instance1.
Updating instance2.
Updating instance.
Updating zopepy.
Updating supervisor.

我在另一个 zope 实例上有一个非常相似的设置,该实例从一开始就以这种方式配置,并且它没有“实例”部分。

我们正在运行 zc.buildout 1.4.4 和 Python 2.4.6 构建 Plone 3.3.6。

我已尝试以下操作,没有任何改变: * 升级到构建 1.5.2 * 从base.cfg 中删除零件分配

We're switching from one to two Zope instances for our productoin Plone deployment. I have the following buildout structure defined:

buildout.cfg

[buildout]
extends = app.cfg
... some environment specific stuff

app.cfg

[buildout]
extends = base.cfg

parts =
    zope2
    productdistros
    instance1
    instance2
    zopepy
    supervisor

[instance1]
<= instance
http-address = 18081

[instance2]
<= instance
http-address = 18082

base.cg

[buildout]
parts =
    zope2
    productdistros
    instance
    zopepy

... bulk of buildout configuration suitable for both server and development

Testing this I'd expect this buildout configuration to result in the existing instance part to be deleted and replaced with instance1 and instance2. However the instance part is not deleted - it can still be found in bin and parts directory.

[zopetest@dev home]$ bin/buildout
Updating zope2.
Updating fake eggs
Updating productdistros.
Updating instance1.
Updating instance2.
Updating instance.
Updating zopepy.
Updating supervisor.

I have a very similar set-up on a different zope instance that was configured this way from the start and it has no "instance" part.

We're running zc.buildout 1.4.4 with Python 2.4.6 building Plone 3.3.6.

I've tried the following with no change:
* upgrading to buildout 1.5.2
* removing the parts assignment from base.cfg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

扭转时空 2025-01-08 08:22:47

这是 plone.recipe.zope2instance 的“功能”。传统上,该配方避免删除它为运行 plone 创建的实例和脚本(无论出于何种原因:要么是糟糕的设计,要么是故意的决定,我不确定)。

无论它的价值如何,从版本 4.2.0 开始,有 支持生成非克隆脚本(类似于 zc.recipe.egg)并且这些脚本得到正确管理。请参阅:

对于所有血淋淋的细节。 (我相信“功能”是安装方法不会返回元组,除非您使用脚本,在这种情况下会返回包含脚本的元组。)

This is a "feature" of plone.recipe.zope2instance. Traditionally the recipe has avoided removal of the instances and scripts it creates for running plone (for whatever reason: either poor design or deliberate decision, I am not sure).

For whatever it is worth, as of version 4.2.0 there is support for generating non-plone scripts (similar to zc.recipe.egg) and those scripts are managed properly. See:

for all the gory details. (I believe the "feature" is that the install method does not return a tuple, unless you are using scripts in which case a tuple containing the scripts is returned.)

神经暖 2025-01-08 08:22:47

这实际上是由于 zc.buildout 自动零件选择功能

当通过变量替换或初始化配方引用带有配方的部分时,该部分将被视为一个部件,并在引用部件之前添加到部件列表中

我有以下部分,

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

因为它引用了“实例”部分“实例”包含在零件列表中。

为了解决这个问题,我将其更改为复制粘贴实例的 Egg 值

eggs =
    Plone
    ${buildout:eggs}

,然后运行 ​​bin/buildout

This was in fact due to the zc.buildout automatic part selection feature

When a section with a recipe is referred to, either through variable substitution or by an initializing recipe, the section is treated as a part and added to the part list before the referencing part

I had the following section

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

As it referenced the “instance” section “instance” was included in the list of parts.

To fix I changed it to copy-paste the eggs value of instance

eggs =
    Plone
    ${buildout:eggs}

and then ran bin/buildout

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文