轉載 利用ANT構建CI系統

heming96發表於2008-09-09

<wbr><wbr><wbr>最近公司要實現一個系統,該系統要能自動從SVN伺服器Check原始碼,自動編譯,自動執行測試用例,自動生成測試報告,測試報告以郵件發出,自動deploy應用程式.

<wbr><wbr><wbr>綜合考慮,發現使用apache ant完全可以滿足這些需求。以下是實現這些功能的ant指令碼。

http://203.208.39.99/search?q=cache:u1ar1LACQKwJ:blog.sina.com.cn/s/blog_59f1ec9a0100aciu.html+svnkit%E4%BD%BF%E7%94%A8&hl=zh-CN&ct=clnk&cd=11&gl=cn&st_usg=ALhdy28dQZeXZny4ueHEydav-vtFshRW-w

[@more@]
<wbr><wbr><wbr>
<!--

--&gt

<wbr>
<wbr><!--local work dir--&gt
<wbr>
<wbr>

<wbr>
<wbr>
<wbr>
<wbr><!--gameserver.war--&gt

<wbr>
<wbr>
<wbr>
<wbr>
<wbr>
<wbr>
<wbr><!--junit config property--&gt

<wbr>
<wbr>
<wbr>
<wbr>

<wbr>
<wbr>

<wbr><!--classpath config property--&gt
<wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr> <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr>

<wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr>
<wbr><wbr><!-- copy to the classes directory --&gt
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr>
<wbr>
<wbr><!--compile--&gt
<wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr>

<wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr>

<wbr>
<wbr><!--junit--&gt
<wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr>

<wbr><wbr><wbr><!--jar test result--&gt
<wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr>
<wbr>
<wbr><!--config mail--&gt
<wbr>
<wbr><wbr>
<wbr><wbr><wbr> <wbr>
<wbr><wbr><wbr>
<wbr><wbr><wbr>The nightly junit test has completed(refer to attachment)
<wbr><wbr><wbr> <wbr>
<wbr><wbr><wbr><wbr>
<wbr><wbr><wbr>

<wbr><wbr>

<wbr>

<wbr>
<wbr>
<wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>webxml="${gameserver.war}/WEB-INF/web.xml">
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><!-- This is included in the war task already --&gt
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr> <wbr>
<wbr>

<wbr>

<wbr><wbr>

<wbr><wbr><wbr>

<wbr><wbr>

<wbr><wbr>

<wbr><wbr><wbr><wbr><wbr>

<wbr><wbr>

<wbr><wbr><wbr>

<wbr><wbr>

<wbr>

<!--clean--&gt
<wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr>
<wbr><wbr><wbr>

<wbr><wbr><wbr>

<wbr><wbr><wbr>從SVN伺服器Checkout原始碼,我使用的是SVNkit.SVNkit是一個完全基於Java的Subversion開源工具庫。SVNKit支援Java API控制和操作Subversion工作複製和資源。SVNKit支援http,https,svn和svn+ssh連線協議等.

<wbr><wbr><wbr>SVNkit的官方網址是

<wbr><wbr><wbr>SVNkit與Ant整合參考了這篇文件

<wbr>

這個CI系統是根據現有公司的一些開發環境構建的,執行指令碼可能有一些特殊配置。請使用的時候注意修改。以滿足自己的需要.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9614263/viewspace-1010388/,如需轉載,請註明出處,否則將追究法律責任。

相關文章