views:

166

answers:

2

I got back from the weekend to discover that somebody *ahem* had missed a file commit last thing Friday afternoon... Cruise control has been having fun, and tried to re-build every five minutes since then despite no further commits.

This means that my colleagues and I have received approximately six hojillion emails from cruise control. A single fail email would be more than enough to notify us.

Is there any way to stop cruise control building on failure, at least until a new commit occurs?


Edit: Added config xml

<project name="XXXX">
<listeners>
  <currentbuildstatuslistener file="logs/${project.name}/status.txt" />
</listeners>
<bootstrappers>
  <svnbootstrapper file="https://XXXXX/trunk/build/cruisecontrol.xml" username="XXXX" password="XXXX" />
</bootstrappers>
<modificationset quietperiod="300">
  <svn localWorkingCopy="projects/${project.name}/" RepositoryLocation="https://XXXXX/trunk/project1" username="XXXX" password="XXXX" />
  <svn localWorkingCopy="projects/${project.name}/" RepositoryLocation="https://XXXXX/trunk/project2" username="XXXX" password="XXXX" />
  <svn localWorkingCopy="projects/${project.name}/" RepositoryLocation="https://XXXXX/trunk/project3" username="XXXX" password="XXXX" />
  <svn localWorkingCopy="projects/${project.name}/" RepositoryLocation="https://XXXXX/trunk/project4" username="XXXX" password="XXXX" />
</modificationset>
<schedule interval="300">
  <ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build/cruisecontrol.xml" propertyfile="projects/${project.name}/project1/production.build.properties" />
</schedule>
<log dir="logs/${project.name}/">
  <merge file="projects/${project.name}/_reports/checkstyle_report.xml" />
  <merge dir="projects/${project.name}/_reports/pmd_report.xml" />
  <merge dir="projects/${project.name}/_reports/junit" />
</log>
<publishers>
  <onsuccess>
    <artifactspublisher dest="artifacts/${project.name}" dir="projects/${project.name}/_dist" />
    <artifactspublisher dest="artifacts/${project.name}" dir="projects/${project.name}/_reports" subdirectory="_reports"/>
  </onsuccess>
  <email spamWhileBroken="true" returnAddress="[email protected]" subjectPrefix="[BUILD]" buildResultsURL="http://XXXXX/dashboard/build/detail/project" mailHost="mail.XXXXX.com" skipUsers="true" >
    <failure address="[email protected]" />
    <success address="[email protected]"/>
 </email>
</publishers>

+1  A: 

I thought it was possible to configure cruise control to only build when it detected changes in the version control system. If the build breaks, and you don't check anything in, Cruise should simply check the source code repository, find no changes, and go back to sleep til next time.

duffymo
I've seen it occasionally get into loops when there's an error checking things out of source control. This can happen, for example, if someone checks in a file that was previously not checked in (e.g. erroneously checking in a .exe or something). But I'm pretty sure that's been fixed in the latest version anyway...
Dean Harding
It *usually* only builds when it detects a change, but if the build fails, it tries again 5 minutes later... and 5 minutes after that... and 5 minutes after that... and so on until my inbox is overflowing
RodeoClown
RodeoClown: I'd say you have a configuration problem, because that's the not expected behaviour. Can you post the section of your configuration file for the project?
Dean Harding
@codeka - I've added the config. It has spamWhileBroken = true, but I checked cruise control's doc ( http://cruisecontrol.sourceforge.net/main/configxml.html#email ) and it says that it just emails on subsequent broken builds. I'm trying to stop those builds occuring
RodeoClown
+1  A: 

Isn't buildafterfailed attribute of <project> the thing you need?

Description of the attribute in the CruiseControl config reference:

Should CruiseControl keep on building even though it has failed and no new modifications are detected? This feature is useful if you want CruiseControl to detect situations where a build fails because of outside dependencies (like temporary failing database connection).

Grzegorz Oledzki
Thanks, I misread that part in the config - I thought it said it defaulted to NOT rebuilding. Testing now.
RodeoClown
Worked a treat, many thanks :)
RodeoClown