2

I've got a problem publishing my current Project status.

Mapping:

<publishers>  
  <xmllogger /><!-- Log For WebDashboard ##Do not remove##-->    
  <email>
    ...
  </email>
  <onfailure>  
    <exec>
      <executable>echo ERROR > logs/status.txt</executable>
    </exec>
  </onfailure>            
</publishers>

When i want to start my Service i get the following message:

ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Unable to instantiate CruiseControl projects from configuration document. Configuration document is likely missing Xml nodes required for properly populating CruiseControl configuration. Unable to load array item 'onfailure' - Cannot convert from type System.String to ThoughtWorks.CruiseControl.Core.ITask for object with value: "echo ERROR > logs/status.txt"

Does anyone know what that message means?

Thanks in anticipation

Alex

Benjamin Baumann
  • 4,035
  • 2
  • 25
  • 35
a.schwab
  • 251
  • 1
  • 4
  • 15

2 Answers2

5

Are you using CruiseControl or CruiseControl.NET?

If CC.NET, then the "onfailure" node does not exist. Instead you should use the Conditionnal Publisher[1] like this :

<conditionalPublisher>
    <conditions>
        <condition>Failure</condition>
    </conditions>
    <publishers>
        <exec>
            <executable>echo ERROR > logs/status.txt</executable>
        </exec>
    </publishers>
</conditionalPublisher>

You may also need to encapsulate your echo task in a cmd invokation :

<exec>
    <executable>cmd.exe</executable>
    <buildArgs>/c "echo ERROR > logs\status.txt"</buildArgs>
</exec>

[1] http://ccnetlive.thoughtworks.com/ccnet/doc/CCNET/Conditional%20Publisher.html

Benjamin Baumann
  • 4,035
  • 2
  • 25
  • 35
  • Thanks for your reply, I've tried your solution, now i get the Error Message: ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Unused node detected: Failure echo ERROR > logs/status.txt I'm using version 1.5.7256.1 – a.schwab Dec 20 '10 at 09:34
  • Sure, it works, im sorry i didnt knew that it's a subnode of publishers, very thanks to your supply. (: – a.schwab Dec 20 '10 at 09:46
0

From the documentation, it looks like <executable> has to be the name of the executable and the arguments must be passed in <buildArgs>. So something like this may do the trick.

<exec>
  <executable>echo</executable>
  <buildArgs>ERROR > logs/status.txt</buildArgs>
</exec>
Raghuram
  • 51,854
  • 11
  • 110
  • 122