CruiseControl日构建简单配置
CruiseControl使用筆記
本文所用cruisecontrol版本是2.8。
1.?日構建配置
日構建是指在每天指定的時間進行構建。
1.1.?<Project>
requireModification?設為?false,含義是無論有沒有變化,都要進行構建。
1.2.?<Listener>
????<listeners>
??????<currentbuildstatuslistener?file="logs/${project.name}/status.txt"/>
</listeners>
如果沒有設置,?那么dashboard上的status將是空,但并不影響大局,一般就如上配置。
1.3.?<bootstrappers>
Bootstrappers配置了檢查變更前的任務,也在Schedule中的任務之前。這里要完成schedule中任務所依賴的文件的更新。
比如
<bootstrappers>
??<tfsbootstrapper?itemSpec=“[vstsworkspace]/[setuppath]/build.xml?/>
</bootstrappers>
而cruisecontol給出的connectfour例子:
<bootstrappers>
????????????<antbootstrapper?anthome="apache-ant-1.7.0"?buildfile="projects/${project.name}/build.xml"?target="clean"?/>
</bootstrappers>
實際上沒有必要,大可放到?schedule中的任務中。
1.4.?<modificationset>
對于日構建,這其實是不需要的,但由于cc必須要1個mondification,可以配一個無效。兩個建議:
1,配成檢查本機某個目錄,這個目錄不需要變化;?
????<modificationset?>
??????<filesystem?folder="D:/WWS/JJJ"/>
????</modificationset>
2,配成timebuild
????<modificationset?>
??????<timebuild?time="1200"?/>
</modificationset>
這與schedule中的time配置有所沖突,shedule中任務的time設置后,此設置無效。
1.5.?<schedule?>
屬性interval?是設置檢查更新的間隔秒數。如果下面的任務配置了?time,這個屬性會變得無效。
對于日構建任務,建議只設置一個,首選ant任務,全部要完成的動作在ant的build.xml中。
例:
???<schedule?interval="300">
??????<ant?anthome="apache-ant-1.7.0"?buildfile="projects/${project.name}/build.xml"?time="2112"?/>
</schedule>
Build.xml中處理了獲取代碼、編譯、測試、打包、發布等等任務。
1.6.?<log>
如果采用了ant中junit任務,可以用下面語句合并日志。
????<log>
??????<merge?dir="projects/${project.name}/target/test-results"/>
????</log>
1.7.?<publishers>
主要配置email通知。配置簡單,按說明即可。要注意的是,在force?build時,缺省地存在名為"User"的用戶,在發送列表中,但"User"不是一個有效的email,因此加入"User"的別名來解決這個問題。示例如下:
????<publishers>
??????<htmlemail?buildresultsurl="http://xx"?mailhost="smtphost"?username="xxx"?password="xxx"?returnaddress="xxx@yyy.com">
????????<map?alias="User"?address="xxxuser@gmail.com"?/>
?????????<always?address="xxxxx@hotmail.com"?/>
????????
??????</htmlemail>
????</publishers>
對于項目群匯總報告,建議采用?<http>
也可以將build.xml中最后的發布任務放到這里。比如
<publishers>
<onsuccess>
????<antpublisher?antscript="C:/Java/apache-ant-1.6.1/bin/ant.bat"
?????????antworkingdir="D:/workspace/MyProject"
?????????buildfile="build.xml"
?????????target="publish">
?????</antpublisher>
</onsuccess>
</publishers>
總結
以上是生活随笔為你收集整理的CruiseControl日构建简单配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Re:CMM和RUP、XP的关系是什么?
- 下一篇: CMMI5级组织如何设定年度目标