2011-12-15 135 views
0

我一直在瀏覽CruiseControl文檔,發現運行腳本的標籤和 。但是,當我試圖從該標籤運行exe文件時,它不如文檔中描述的那樣工作。如何在CruiseControl上運行exe文件

我也嘗試將批處理文件中的exe調用並從CruiseControl執行它,但也沒有按預期工作。那麼我怎樣才能從CC運行exe文件?我還需要能夠在我的電子郵件通知中包含此文件工作的輸出是否有可能? 例如我有文件UnitTests.exe打印這樣的東西:

Unit tests are passed. 
47 Tests was successful 

我該怎麼做?或者我怎麼能至少從該可執行文件獲取返回的代碼?

回答

1

在ant中運行exec。 在CruiseControl的:

<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> 
+0

感謝您的回答。但你是什麼意思的這條線 doit。我應該寫什麼而不是運行文件UnitTests.exe? – 2012-01-19 14:21:42

0

有選項來執行.bat或。使用以下標記的exe文件。

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

您可以將上面的行放在構建腳本要調用的xml文件的任何目標中。

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

希望這有助於,謝謝。

相關問題