如何使用 hudson 构建多个具有相同 svn 修订号的项目?

发布于 2024-09-02 05:24:39 字数 287 浏览 1 评论 0原文

我刚刚开始使用 hudson,我想像我之前手工制作的解决方案一样构建我的项目:

  1. 检索当前的 svn 修订号rev
  2. 构建修订号为 rev 的所有项目(每个项目都有单独的结果)。
  3. 重新从步骤 1 开始,无论期间是否有任何更改(以检测每次测试运行时不会发生的不确定性错误)。

如何使用 hudson 进行配置?

I'm just starting with hudson and I'd like to build my projects like my handmade solution did before:

  1. Retrieve the current svn revision number rev.
  2. Build all projects (each with individual result) with the revision number rev.
  3. 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 技术交流群。

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

发布评论

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

评论(4

地狱即天堂 2024-09-09 05:24:39

只是为了延长 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.

浪漫之都 2024-09-09 05:24:39

Hudson 对于进行单个 SVN 签出然后将其用于多个不同的工作并没有真正提供良好的支持。

您可以尝试以下操作:

  • 设置一个仅检出已知目录的作业。检查构建后操作>构建其他项目框并添加所有构建作业。
  • 设置每个构建作业以从第一个作业放置的位置复制最新的签出。将它们设置为定期构建,这样即使没有签入,它们也会继续构建。
  • 可以使用 Locks and Latches 插件在签出作业和构建作业之间设置锁,这样您就不会出现两个作业同时尝试复制/修改文件的情况。

这听起来很混乱并且可能充满问题,但它可能会起作用。

或者,如果您想将所有这些项目链接在一起,您可以设置一个作业来进行结帐并为每个项目提供一个构建步骤。然后,您只需检查“定期构建”触发器即可使其按照您想要的频率运行(或者至少按照 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:

  • Set up a job that just does the check-out to a known directory. Check the post-build-actions > build other projects box and add all the build jobs.
  • Set up each of the build jobs to copy over the latest check-out from wherever the first job placed it. Have these set up to build periodically so they will continue to build even when there are no check-ins happening.
  • Possibly use the Locks and Latches plugin to set up locks between the check-out job and the build jobs so you don't end up with two jobs trying to copy/modify the files simultaneously.

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).

等你爱我 2024-09-09 05:24:39

我对这个问题的看法:

使用 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.

霊感 2024-09-09 05:24:39

您始终可以添加 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

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