自动粘贴创建 -t plone3_buildout

发布于 2024-09-02 20:45:18 字数 409 浏览 2 评论 0原文

我想自动化 plone3_buildout 的过程。

解释: 构建克隆站点的默认(我使用的)方法是使用 Paster,如下所示:

paster create -t plone3_buildout

这会问我几个问题,然后为该站点创建一个默认的构建。

我想要什么: 我想使用 buildout 自动化此过程。我的 buildout 将执行这个 paster 命令,将我预先配置的值输入到 Paster 中。

我还没有找到可以做到这一点的食谱。如果有人知道如何执行此操作,请分享信息。

如果有一个配方可以将值提供给交互式命令(具有已知的输出,如 plone3_buildout 命令),那也会很有用。

I want to automate the process of plone3_buildout.

Explanation:
The default(the one I use) way of building a plone site is using paster, like so:

paster create -t plone3_buildout

This asks me a few questions and then create a default buildout for the site.

What I want:
I want to automate this process using buildout. My buildout will execute this paster command, feed in my preconfigured values to the paster.

I haven't found a recipe which can do this. If someone has an idea of how to do this, please share the info.

If there is a recipe which can feed values to interactive commands(with known output, like with plone3_buildout command), that would be useful too.

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

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

发布评论

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

评论(2

離殇 2024-09-09 20:45:18

paster create 命令可以接受 --config 选项。这允许您生成或使用包含问题答案的文件。

$ paster create -t plone3_buildout --config=saved.cfg my-buildout
...
answer questions
...

现在当前目录中将有一个 buildout.config 文件。

$ cat saved.cfg
[pastescript]
eggifiedplone__eval__ = True
zope_user = admin
expert_mode = all
zope2_install = 
plone_products_install = 
tarballs__eval__ = False
egg_plugins__eval__ = []
plone_version = 3.3.4
debug_mode = off
plus = +
dot = .
zope_password = 
http_port__eval__ = 8080
egg = test_buildout
z29tarballs__eval__ = False
eggifiedzope__eval__ = False
verbose_security = off

您可以修改此文件并使用相同的命令运行 Paster。

$ paster create -t plone3_buildout --config=saved.cfg my-new-buildout

这次它不会问你任何问题。所有的答案都来自配置文件。最新的 ZopeSkel(2.15+)还可以将这些设置存储在 $HOME/.zopeskel 中。

The paster create command can accept a --config option. This allows you to generate or use a file with answers to the questions.

$ paster create -t plone3_buildout --config=saved.cfg my-buildout
...
answer questions
...

Now there will be a buildout.config file in the current directory.

$ cat saved.cfg
[pastescript]
eggifiedplone__eval__ = True
zope_user = admin
expert_mode = all
zope2_install = 
plone_products_install = 
tarballs__eval__ = False
egg_plugins__eval__ = []
plone_version = 3.3.4
debug_mode = off
plus = +
dot = .
zope_password = 
http_port__eval__ = 8080
egg = test_buildout
z29tarballs__eval__ = False
eggifiedzope__eval__ = False
verbose_security = off

You can modify this file and run paster with the same command.

$ paster create -t plone3_buildout --config=saved.cfg my-new-buildout

This time it won't ask you any questions. All of the answers will come from the config file. The latest ZopeSkel (2.15+) also has a way to store these settings in $HOME/.zopeskel.

超可爱的懒熊 2024-09-09 20:45:18

有一个名为“expect”的实用程序,它是为自动化交互式命令行操作而设计的。

http://expect.nist.gov

另一种方法是修改或克隆并自定义 plone3_buildout 脚本和 ZopeSkel 包中的模板。

然而,此时,如果您对所有变量进行硬编码,您不妨创建一次构建,放入版本控制中,然后复制/克隆它以创建新实例。

There is a utility called "expect" which is designed for automating interactive command line operations.

http://expect.nist.gov

Another approach would be to modify or clone-and-customize the plone3_buildout script and template in the ZopeSkel package.

However at that point, if you're hardcoding all the variables, you might as well create the buildout once, put in into version control, and copy/clone it to make new instances.

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