开发者

Need CruiseControl modification set in custom ant task

开发者 https://www.devze.com 2023-01-18 18:54 出处:网络
Is there any way to pass the CruiseControl modification set to a custom ant task? My setup: I have a CruiseControl (the original one, not CC.NET or suchlike) instance that monitors a SVN repository o

Is there any way to pass the CruiseControl modification set to a custom ant task?

My setup: I have a CruiseControl (the original one, not CC.NET or suchlike) instance that monitors a SVN repository of binary packages waiting to be tested. Whenever a new binary package appears, this package should be sent to another "test host" to test it. This works in general via a custom ant task, but has a snatch...

The problem is that the binary packages are built for multiple architectures. My custom ant task should select that "test host" that matches the architecture of the binary package (it maintains an internal list of "test hosts" for that purpose). At the moment, all "test hosts" get notified to run their tests whenever a new package for any architecture appears.

So, my idea of an ideal CruiseControl project logic would be:

  • CruiseControl monitors an SVN directory for changes via <modificationset> (and also a local file which should trigger all "test hosts")
  • On any modification, an ANT script is called by CruiseControl, which in turn calls a custom ANT task
  • This custom ANT task needs to know which files exactly have been modified to trigger the CruiseControl run so that it can select the correct "test host" based on the names of the modificated files (they contain the architecture in their name)

My question is: How can I pass the modificationset to that ANT task?

One s开发者_开发问答olution idea I stumbled upon was the "Modification Writer" plugin, but that one is apparently only available for CruiseControl.NET. :-(


True, the log file does contain all of the information. But you are out of luck if you want to use it inside your ant task. This file isn't written to the disk until after the build completes. Alas, you don't get to see the modification set when you want to.


There is not already a ready made solution for this, however it's not hard to solve your problem by doing the following :

For each project a specific log file exist in .xml format. The file has a name such as this : log20110913113343.xml. The ant task knows the log at all times. Now what you need to do is extract the information you want from this file, for example :

 <modification type="clearcase">
  <file action="checkin">
    <revision>\main\axpro_LATESTfo\4</revision>
    <filename>expected</filename>
    <project>calibration\algorithms\test.u\DetectMarkersMetaTest</project>
  </file>
  <date>2011-09-12T14:22:28</date>
  <user>z002tv9v</user>
  <comment><![CDATA[Added file element "testcase_1.01.txt".
              Added file element "testcase_1.02.txt".
              Added file element "testcase_1.03.txt".
              Added file element "testcase_1.04.txt".
              Added file element "testcase_1.05.txt".
              Added file element "testcase_1.06.txt".]]></comment>
  <revision>\main\axpro_LATESTfo\4</revision>
</modification>

There you can find all the files that were modified by the current modification set. Once you do this then you can pass them onto your custom task and go up from there. I would use xsl to extract the data I want from the file but of course you can use whatever tech you want :)

Hope it helped!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号