cruisecontrol.netcruisecontrolccnet-config

Conditional force build publisher CCnet fails


I have two build projects. lets call them project A and project A.pack. When I force build project A it asks me for Boolean parameter if I want to build project A.pack.

But I can't make in publishers block of project A a correct way to force build the project A.pack. I use conditional task but it doesn't work. In log file ccnet writes only that it fails on conditional task. What a usual way to do this in ccnet?

Update: Sorry for my English. It's not my first language. What I wanted to do is this: In project A I added Boolean parameter:

<booleanParameter>
    <name>ExampleParam</name>
    <true name="Yes">1</true>
    <false name="No">0</false>
    <display>Example Param</display>
    <default>No</default>
    <required>false</required>
</booleanParameter>

And added conditional forcebuild in publishers like this:

<publishers>
  <!-- some other tasks .. -->
  <conditional>
    <conditions>
      <compareCondition>
        <value1>${ExampleParam}</value1>
        <value2>1</value2>
        <evaluation>equal</evaluation>
      </compareCondition>
    </conditions>
    <tasks>
      <forcebuild>
        <project>A.pack</project>
        <serverUri>tcp://localhost:21235/CruiseManager.rem</serverUri>
      </forcebuild>
    </tasks>
  </conditional>
</publishers>

When I press "force" it asks me for "Example Param", I check "Yes" and when it finishes building dashboard says that build was succesful but ForceBuildPublisher task failed. There is no information in server log about why force build task failed.

It's CruiseControl.NET-1.6.7

Update 20150808: I convinced my colleagues to update CCnet. In version 1.8.5 it's possible to do a conditional build like I wrote.


Solution

  • If the boolean parameter is true then write to a file that A.pack watches. A.pack builds if the file gets dirty. See Filesystem Source Control Block for use by A.pack in listening to the file made dirty by A.