a.schwab
a.schwab

Reputation: 261

Cruisecontrol Publish command onfailure

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

Upvotes: 2

Views: 944

Answers (2)

Raghuram
Raghuram

Reputation: 52655

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>

Upvotes: 0

Benjamin Baumann
Benjamin Baumann

Reputation: 4065

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

Upvotes: 5

Related Questions