具有多个触发器的 Hudson 项目

发布于 2024-11-09 08:59:11 字数 355 浏览 0 评论 0原文

我正在与 Hudson 构建一个持续集成系统,并将一个项目分为两部分。第一个是主要的构建和单元测试元素,我想以传统 CI 方式运行,由 SVN 触发。第二个是功能测试,需要很长时间才能运行,所以我希望它们能连夜运行。

有没有办法设置具有多个触发器的 Hudson 项目,即当且仅当主项目已更改并成功构建时,每晚都会运行功能测试。

我看到过这个问题:Hudson - 不同触发器的不同构建目标,但无论主项目的状态如何,它都会每天晚上运行。

I am building a continuous integration system with Hudson, and have a project split into two parts. The first is the main build and unit test element, which I want to run in the traditional CI fashion, triggered off SVN. The second is the functional tests, which take a long time to run, and so I want them to run overnight.

Is there any way of setting up a Hudson project with multiple triggers, i.e. so the functional tests run each night if and only if the main project has changed and has built successfully.

I've seen this question: Hudson - different build targets for different triggers, but that simply runs each night regardless of the state of the main project.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

韵柒 2024-11-16 08:59:11

我遇到的情况与您完全相同:带有与 SVN 相关的一些快速健全性测试的构建,但每晚回归测试需要更长的时间。

我们的解决方案是使用 DOS 构建触发器插件。在该构建触发器上,我们附加了一个每晚触发一次的时间表。触发脚本是一系列简单的命令,如下所示:

set CAUSE=
curl  http://localhost:8080/job/THEBUILDJOB/lastSuccessfulBuild/artifact/fingerprint.txt -o current.txt
if not exist current.txt exit 0
fc /B current.txt last.txt
if ERRORLEVEL 1 set CAUSE=New build available
copy /y current.txt last.txt

它从上次成功构建中获取特定文件 (fingerprint.txt),并将其(通过 fc)与我们存储在工作区中的副本进行比较。如果它们匹配 - 则不会发生构建。如果它们不同,我们通过设置 CAUSE 变量来通过 DOS 构建触发器触发构建,然后将新文件存储在触发器的工作区中。

I have exactly the same situation that you do: a build with some quick sanity tests tied to SVN, but a nightly regression test that takes longer.

Our solution was to use the DOS Build Trigger Plugin. On that build trigger, we attach a schedule that triggers once a night. The Trigger Script is a series of simple commands like this:

set CAUSE=
curl  http://localhost:8080/job/THEBUILDJOB/lastSuccessfulBuild/artifact/fingerprint.txt -o current.txt
if not exist current.txt exit 0
fc /B current.txt last.txt
if ERRORLEVEL 1 set CAUSE=New build available
copy /y current.txt last.txt

This gets a particular file (fingerprint.txt) from the last successful build and compares it (via fc) to a copy we've stored in the workspace. If they match - no build occurs. If they're different, we trigger a build via the DOS Build Trigger by setting the CAUSE variable, then store the new file in the trigger's workspace.

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