Hackish method to include custom content into CruiseControl


94986649_3e22dce4b4_b Disclaimer: I’m a CruiseControl newbie, so there might well be a much better / simpler / cleaner method to achieve this. However this is the way I managed to get it working.

  1. Write your (Perl) script and make it output something like this:
    
    <testsuite tests="0" name="summary" failures="0"><system-out>
    foo bar
    </system-out></testsuite>
  2. Make your script run during the build. This can be done directly using exec or in an ant subtask using the exec task. One thing to keep in mind is that CC stops at the first failure – this can be important if you want to run your script even during failures (because it collects statistics about the failures for example)
  3. Check that the output is present in the XML resulting from the XML log.
  4. Hack the XSL such that the contents are displayed in the result HTML email for example:
    
    <table align="center" cellpadding="2" cellspacing="0" border="0" class="header" width="98%"><tr><td>
      <pre><xsl:value-of select="/cruisecontrol/testsuite[@name='summary']/system-out" /></pre>
    </td></tr></table>
    

That’s it folks! Hope that somebody finds it useful.

Picture taken chippenziedeutch’s photostream with permission.


Leave a Reply

Your email address will not be published. Required fields are marked *