Cruisecontrol 失败时发布命令

发布于 2024-10-08 20:36:33 字数 729 浏览 7 评论 0原文

我在发布当前项目状态时遇到问题。

映射:

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

当我想启动我的服务时,我收到以下消息:

ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: 无法从配置文档实例化 CruiseControl 项目。 配置文档可能缺少正确填充 CruiseControl 配置所需的 Xml 节点。 无法加载数组项“onfailure” - 无法从 System.String 类型转换为 ThoughtWorks.CruiseControl.Core.ITask 的对象,其值为:“echo ERROR >logs/status.txt”

有谁知道该消息的含义吗?

期待

感谢亚历克斯的

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半仙 2024-10-15 20:36:33

您使用的是 CruiseControl 还是 CruiseControl.NET?

如果是CC.NET,则“onfailure”节点不存在。相反,您应该像这样使用条件发布器[1]:

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

您可能还需要将 echo 任务封装在 cmd 调用中:

<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

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

苯莒 2024-10-15 20:36:33

文档来看,它看起来像< /code> 必须是可执行文件的名称,并且参数必须在 中传递。所以像这样的事情可能会起作用。

<exec>
  <executable>echo</executable>
  <buildArgs>ERROR > logs/status.txt</buildArgs>
</exec>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文