views:

58

answers:

1

Question

How do I setup Hudson so that if one person triggers a build, Hudson will put it on the queue and wait lets say 2 minutes, and during those 2 minutes if another build is triggered it will replace the older build on the queue with the new build?

This way if there are 2 builds in those 2 minutes, Hudson will only perform the last build.

+5  A: 

Under Manage Hudson, set the Quiet Period.

If set, a newly scheduled build waits for this many seconds before actually being built. This is useful for:

  • Collapsing multiple CVS change notification e-mails into one (some CVS changelog e-mail generation scripts generate multiple e-mails in quick succession when a commit spans across directories).

  • If your coding style is such that you commit one logical change in a few cvs/svn operations, then setting a longer quiet period would prevent Hudson from building it prematurely and reporting a failure.

  • Throttling builds. If your Hudson installation is too busy with too many builds, setting a longer quiet period can reduce the number of builds.

If not explicitly set at project-level, the system-wide default value is used.

Dave Bacher
how do i set configure it to do what I stated earlier?
MikeU
@MikeU, if you set the Quiet Period to 120 seconds, after the first commit, Hudson will wait for 2 minutes before starting the build. If another commit happens in that 2 minutes, Hudson will delay starting the build for another 2 minutes after the second commit. I think this accomplishes your goal of only building once if there are multiple commits (triggers) in close succession.
Dave Bacher
Thanks! Thats exactly what I wanted.
MikeU