cruisecontrol – Grey Panthers Savannah https://grey-panther.net Just another WordPress site Fri, 10 Apr 2009 14:53:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 206299117 Hackish method to include custom content into CruiseControl https://grey-panther.net/2009/04/hackish-method-to-include-custom-content-into-cruisecontrol.html https://grey-panther.net/2009/04/hackish-method-to-include-custom-content-into-cruisecontrol.html#respond Fri, 10 Apr 2009 14:53:00 +0000 https://grey-panther.net/?p=317 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.

]]>
https://grey-panther.net/2009/04/hackish-method-to-include-custom-content-into-cruisecontrol.html/feed 0 317