如何使用 hudson 构建多个具有相同 svn 修订号的项目?
我刚刚开始使用 hudson,我想像我之前手工制作的解决方案一样构建我的项目:
- 检索当前的 svn 修订号rev。
- 构建修订号为 rev 的所有项目(每个项目都有单独的结果)。
- 重新从步骤 1 开始,无论期间是否有任何更改(以检测每次测试运行时不会发生的不确定性错误)。
如何使用 hudson 进行配置?
I'm just starting with hudson and I'd like to build my projects like my handmade solution did before:
- Retrieve the current svn revision number rev.
- Build all projects (each with individual result) with the revision number rev.
- Start again with step 1 regardless if there were any changes in the meantime (to detect nondeterministic errors that don't occur on every test run).
How can I configure this with hudson?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只是为了延长 sjohnston 的职位。您可以使用 克隆工作区SCM插件。现在您可以参考第一份工作的结帐。
此外,您可以仅传递修订号并将其作为参数传递给构建作业。然后,构建作业可以使用修订号检索正确的代码版本。
Just to extend the sjohnston post. Instead of checking the code out to a known location, you can use the Clone Workspace SCM Plugin. Now you can reference the checkout from the first job.
In addition you can just pass around the revision number and pass it as a parameter to your build jobs. The build jobs can than retrieve the right version of code by using the revision number.
Hudson 对于进行单个 SVN 签出然后将其用于多个不同的工作并没有真正提供良好的支持。
您可以尝试以下操作:
这听起来很混乱并且可能充满问题,但它可能会起作用。
或者,如果您想将所有这些项目链接在一起,您可以设置一个作业来进行结帐并为每个项目提供一个构建步骤。然后,您只需检查“定期构建”触发器即可使其按照您想要的频率运行(或者至少按照 Hudson 完成任务的频率运行)。
Hudson doesn't really have good support for making a single SVN check-out and then using it for several different jobs.
You could try this:
It sounds messy and potentially fraught with problems, but it might work.
Alternately, if you want to just chain all these projects together, you could set up a single job that does the checkout and has a build step for each project. Then you could just check the Build Periodically trigger to have it run as often as you want (or at least as often as Hudson can get through the tasks).
我对这个问题的看法:
使用 SVN post-commit hook触发初步工作,其中 a) 检查代码; b) 获取 SVN 修订版(例如通过 SVNVERSION.EXE); c) 使用参数化触发器插件来触发“ real”在特定 SVN 修订 ID 处构建作业。
通过这种方式,您可以将 SCM 连接与实际构建分开,以便您可以非常具体地构建每个版本。
My take on the problem:
Use the SVN post-commit hook to trigger a preliminary job which a) checks out the code; b) gets the SVN revision (e.g. via SVNVERSION.EXE); and c) uses the Parameterized Trigger plugin to trigger the "real" build job at the specific SVN revision ID.
This way you separate the SCM connection from the actual building, so that you can be very specific about building every revision.
您始终可以添加 shell 脚本作为构建步骤。
使用参数化构建,将修订版本声明为参数,在 shell 脚本中使用该参数(完全跳过 Hudson SCM 管理)
http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Build
you can always add a shell script as a build step.
use a parameterized build, declare the revision as parameter, use the parameter in your shell script (skipping Hudson SCM management entirely)
http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Build