一、软件准备
1,下载 cruisecontrol-bin-2.8;
http://sourceforge.net/project/showfiles.php?group_id=23523&package_id=16338&release_id=629858
2,Ant: 用Cruisecontrol自带的ant1.7.0
3,下载SVN;
http://subversion.tigris.org/files/documents/15/43360/Setup-Subversion-1.5.1.en-us.msi
二、安装配置
1, 解压缩cruisecontrol到指定的目录;
2,在环境变理里增加ANT_HOME指向cruisecontrol-bin-2.8下的ant1.7.0;然后再在path里增加%ANT_HOME%/bin;
3, 安装SVN;安装完成后应用你的账号登录SVN,记住要保存密码;
4,config.xml配置
<cruisecontrol>
<project name="AIVR">
<listeners>
<currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
</listeners>
<bootstrappers>
<svnbootstrapper localWorkingCopy="projects/${project.name}" />
</bootstrappers>
<modificationset quietperiod="600">
<svn localWorkingCopy="projects/${project.name}"/>
</modificationset>
<schedule interval="43200">
<ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/>
</schedule>
<log>
<merge dir="projects/${project.name}/test-reports"/>
</log>
<publishers>
<htmlemail
charset="UTF-8"
mailhost=" "
defaultsuffix=" "
username=""
password=" "
returnname="AIVR Daily Build"
returnaddress=" "
subjectprefix="Cruise Control Build"
xsldir="webapps/cruisecontrol/xsl"
css="webapps/cruisecontrol/css/cruisecontrol.css">
<always address="your email address "/>
<propertiesmapper file="mailaddress.properties"/>
</htmlemail>
</publishers>
</project>
</cruisecontrol>
增加mailaddress.properties文件,用来将SVN的账号(域名"用户名)转成Email;内容如下
域名""用户名=你的Email地址
……
5,在SVN下新建文件夹,与config.xml的project name同名,check out项目的代码;
6,build.xml不用作修改,但必须要有可运行的build.xml文件;
三、测试应用
运行cruisecontrol,最先会从SVN上再下载一遍代码,并且进行构建,将构建的结果通过Email发送给你。
这当然只是一个最简单的应用,更多的功能需要我们大家一起交流与学习。