开发者

Automate paster create -t 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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜