有没有使用 Mercurial 的 buildbot 的工作示例
使用的 buildbot 版本是:
$ buildbot --version Buildbot version: 0.8.3p1 Twisted version: 10.1.0
Checkconfig,给我错误:
$ buildbot checkconfig /usr/lib/python2.6/dist-packages/twisted/mail/smtp.py:10: DeprecationWarning: the MimeWriter module is deprecated; use the email package instead import MimeWriter, tempfile, rfc822 Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/runner.py", line 1071, in doCheckConfig ConfigLoader(configFileName=configFileName) File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/checkconfig.py", line 46, in __init__ self.loadConfig(configFile, check_synchronously_only=True) File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/master.py", line 883, in loadConfig % (b['name'], n)) ValueError: builder runtests uses undefined slave example-slave $
这是我查看的一个示例:
http://agiletesting.blogspot.com/2006/02/continuous-integration-with-buildbot.html
buildbot version being used is:
$ buildbot --version Buildbot version: 0.8.3p1 Twisted version: 10.1.0
Checkconfig, gives me errors:
$ buildbot checkconfig /usr/lib/python2.6/dist-packages/twisted/mail/smtp.py:10: DeprecationWarning: the MimeWriter module is deprecated; use the email package instead import MimeWriter, tempfile, rfc822 Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/runner.py", line 1071, in doCheckConfig ConfigLoader(configFileName=configFileName) File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/checkconfig.py", line 46, in __init__ self.loadConfig(configFile, check_synchronously_only=True) File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/master.py", line 883, in loadConfig % (b['name'], n)) ValueError: builder runtests uses undefined slave example-slave $
Here is one example i looked at :
http://agiletesting.blogspot.com/2006/02/continuous-integration-with-buildbot.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这涉及到:
我在使用简单的 hg 存储库时遇到了一些严重的问题,而同一个项目在 git 和适当的功能上运行良好。所以就是这样。
master.cfg 中有三个地方处理我们的存储库:changesources、调度程序和构建器,其中只有使用 Mercurial 特定功能的 Changesources 和构建器。
在 changesources 部分:
这里我使用
HgPoller
,而不是PBChangeSource
。后者更复杂,但也需要更多配置步骤(提供端口以及另一个用户名和密码)。repourl
必须指向 hg 存储库的根目录。任何可用于“hg pull”或“hg clone”的 URL 都是可接受的。此示例涉及本地存储库,但它可能位于服务器上,那么您可以指定 http 或其他内容。Mercurial 上的默认
分支
是“default”。pollInterval=30
表示每 30 秒检查一次新提交(这来自一个玩具示例,实际上 > 30 会更合适)。现在是构建器,它在调度程序检测到并传递提交后构建:
解释为什么我的东西不起作用是因为我没有指定
defaultBranch
和branchType
。这些关键字与 Git() 不同,所以要小心。这有点棘手,因为我没有在在线用户手册中找到它们,但如果您在 python 解释器中花点时间,它就在那里:另外,请注意,这是从
buildbot.steps.source 导入的 Mercurial 函数。 Mercurial
,它与您从buildbot.steps.source.Mercurial
导入的 Mercurial 函数不同。后者已被弃用(或者您将在旧版本上使用的内容)。感谢 freenode 上 IRC buildbot 频道的 tomprince 指出了这一点。This pertains to:
I had some serious issues to get it working with a simple hg repo, while the same project worked fine with git and the appropriate functions. So here it is.
There are three places deal with our repo in master.cfg: changesources, schedulers and builders, with only changesources and builders that use mercurial specific functions.
In changesources section:
Here I use
HgPoller
, instead ofPBChangeSource
. The latter is more sophisticated but also requires more configuration steps (provide a port and yet another username and password).repourl
must point to the root of your hg repository. Any URL that could be used for "hg pull" or "hg clone" is acceptable. This example involves a local repository, but it could be on a server, then you would specify http something or else.The default
branch
on mercurial is 'default'.pollInterval=30
says every 30 seconds, check for a new commit (this is from a toy example, in reality >30 would be more suitable).Now the builder, which builds after a commit is detected and passed on by the scheduler(s):
What explains why my thing did not work is that I did not specify
defaultBranch
andbranchType
. Those keywords are not the same as with Git(), so beware. This is a little tricky as I did not find them in the user manual online, but it's there if you take a moment within the python interpreter:Also, note that this is the function Mercurial imported from
buildbot.steps.source.mercurial
, which is not the same Mercurial function that you would import imported frombuildbot.steps.source.Mercurial
. The latter is deprecated (or that which you would use on an older version). My thanks to tomprince from the IRC buildbot channel on freenode for pointing that out.您看到的示例非常古老;
c['bots']
不久前已重命名为c['slaves']
,还有更多更改。我建议查看 Buildbot 手册进行配置:
http://buildbot .net/buildbot/docs/current/Configuration.html#Configuration
可能还有安装部分,以确保您执行了设置最新版本的 BuildBot 所需的操作,而不仅仅是旧版本:
http://buildbot.net/buildbot/docs/current/Installation.html#Installation
提供的一个示例是 IcedTea 构建机器人,它是从 Mercurial 存储库构建的。配置可在此处浏览:
http://icedtea.classpath.org/hg/buildbot/file
也欢迎您访问 irc.freenode.net 上的 #buildbot 寻求帮助。
The example you looked at is very old;
c['bots']
was renamed toc['slaves']
a while ago, as well as many more changes.I'd suggest taking a look at the Buildbot manual for configuration:
http://buildbot.net/buildbot/docs/current/Configuration.html#Configuration
And possibly also the installation section, to make sure you did what was required to set up the more recent versions of BuildBot, not just older versions:
http://buildbot.net/buildbot/docs/current/Installation.html#Installation
One example that was offered was the IcedTea buildbot, which builds from Mercurial repos. Configuration is browsable here:
http://icedtea.classpath.org/hg/buildbot/file
You're also welcome to drop by #buildbot on irc.freenode.net for help.