技术开发 频道

关于每日构建|每小时构建

【IT168 技术文章】

    持续集成工具:CruiseControl,俗称cc

    构建工具:Ant (Maven不错,但还未使用熟练)

    应用服务器:tomcat

    版本控制器:Subversion

    一.cc的设置

    首先下载CruiseControl,目前版本是2.7.1,打开目录,找到config.xml文件

<cruisecontrol>
    
<project name="sanitation">

        
<listeners>
            
<currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
           </listeners>

        
<bootstrappers>
            
<svnbootstrapper localWorkingCopy="projects/${project.name}" />
                   </bootstrappers>

        
<modificationset quietperiod="30">
            
<svn localWorkingCopy="projects/${project.name}"/>
                  </modificationset>

        
<schedule interval="3600">
          
<ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/>
          </schedule>

        
<log>
          
<merge dir="projects/${project.name}/target/test-results"/>
                  </log>

        
<publishers>
            
<onsuccess>
                
<artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/target/${project.name}.jar"/>
                            </onsuccess>
            <email mailhost="XXXX" returnaddress="XXX" buildresultsurl="XXXX" skipusers="true" spamwhilebroken="true">
            
<always address=XXX@XXX/>
               <failure address=XXX@XXX/>
            </email>
        </publishers>

    
</project>
</cruisecontrol>

    其中${project.name}根据实际情况改成自己的项目名称,<schedule interval="3600">是指过一小时进行下次轮循,这里单位是秒,<publishers>执行完毕后可以通过发送有邮件方式进行通知,上面是成功或失败都进行通知,这样 cc环境就布置完毕

0
相关文章