【问题标题】:How to run exe file on CruiseControl如何在 CruiseControl 上运行 exe 文件
【发布时间】:2011-12-15 11:27:42
【问题描述】:

我一直在浏览 CruiseControl 文档,发现标签和 用于运行脚本。但是,当我尝试从该标签运行 exe 文件时,它的效果不如文档中描述的那样好。

我还尝试将 exe 调用放在批处理文件中并从 CruiseControl 执行它,但也没有按预期工作。那么如何从 CC 运行 exe 文件呢?我还需要能够在我的电子邮件通知中包含此文件工作的输出,这可能吗? 例如。我有文件 UnitTests.exe 打印如下内容:

Unit tests are passed.
47 Tests was successful

我该怎么做?或者我怎样才能至少从该可执行文件中获取返回代码?

【问题讨论】:

    标签: c++ cruisecontrol


    【解决方案1】:

    在 ant 中运行 exec。 在巡航控制中:

        <schedule>
            <ant anthome="/usr/apache-ant-1.8.2" buildfile="/usr/ant-build-files/my-ant-build-file.build" target="do-task" uselogger="true">
            </ant>
        </schedule>
    

    在 /usr/ant-build-files/my-ant-build-file.build ...

        <target name="do-task">             
            <exec executable="/<path to dir containing exe>/UnitTests.exe" failonerror="true">
            <arg line="<args to UnitTests.exe>"/>
        </exec>
    

    【讨论】:

    • 感谢您的回答。但是你说这行 doit 是什么意思。我应该写什么而不是 doit 来运行文件 UnitTests.exe ?
    • 您能否发布完整的 Nant 配置文件以运行 UnitTests.exe?我会很感激的。
    • 您说的是 CruiseControl 还是 CruiseControl .net?我只对通常的 CruiseControl 感兴趣。您能否发布更具体的 nant 配置文件描述?
    • 我编辑了我的原始帖子以使用常规的 Java Cruisecontrol 和 Ant。
    【解决方案2】:

    可以选择使用以下标签执行 .bat 或 .exe 文件。

      <exec executable="c:/something.exe" />
    

    您可以将上述行放在构建脚本将要调用的 xml 文件的任何目标中。

    <target name="target-to-call-an-exe">
          <exec executable="c:/cygwin/bin/bash.exe" />
    </target>
    

    希望对您有所帮助,谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-15
      • 2020-03-01
      • 1970-01-01
      相关资源
      最近更新 更多