自动粘贴创建 -t plone3_buildout
我想自动化 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
paster create
命令可以接受--config
选项。这允许您生成或使用包含问题答案的文件。现在当前目录中将有一个
buildout.config
文件。您可以修改此文件并使用相同的命令运行 Paster。
这次它不会问你任何问题。所有的答案都来自配置文件。最新的 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.Now there will be a
buildout.config
file in the current directory.You can modify this file and run paster with the same command.
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
.有一个名为“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.