cruiseControl learning

上一篇 / 下一篇  2009-01-21 11:00:17

最近 research CruiseControl tool .自己mark 一下

CruiseControl is both acontinuous integrationtool and an extensible framework for creating a custom continuous build process. It includesdozens of pluginsfor a variety of source controls, build technologies, and notifications schemes including email and instant messaging. A web interface provides details of the current and previous builds. And the standard CruiseControl distribution is augmented through a rich selection of3rd Party Tools.

一个 continuous integration 工具,能团队进行敏捷开发,每过一段时间来进行集成,以便随时能发现引入的错误。当build失败后,将会通知提交者,使其能够更改代码。

cruiseControl(CC)的配置是围绕六个插件来展开的。

在提交之后,build失败了,如果不希望在再次提交代码之前重复的构建,可以有如下设置  <project name="integration" buildafterfailed="false">
----


1. Bootstrapper: cc创建之前运行,是创建前的准备工作 ....Bootstrappers are run before abuildtakes place
<bootstrappers> 
  <currentbuildstatusbootstrapper> 指定了状态文件的位置,主要是用来访问项目当前创建的状态
  <cvsbootstrappers> 可以是其他的源码控制系统,.....就是为从源码控制系统更新ant 的 buildfile 文件而设计的.....
  因为我们每次项目的创建都应该基于最新的代码,因此在创建之前就要获得最新的项目文件, 如果你使用的是ant, 这个工作是由ant 的buildfile来完成的。


2. SourceControl:访问源码控制系统,查看源码自上次build之后是否被修改。并据此决定是否需要进行下一次Build
<modificationset>  ,用于检查各个源码控制系统中是否发生变化,<schedule>会用到这里面的配置信息,如果检测到变化,会触发创建过程。



3. Builder:对项目进行创建,(包括对项目源码的的编译,测试,打包)
<schedule>  定时驱动<modificationset>,如果检测到变化,就执行所指定的builder 的任务。
当<modificationset>检测到修改时,如果没有调用build,下次也不会调用build,因为下次没有检测到失败。
但是build失败时,会一直要重新构建,直到构建成功。有时候需要force build
因此build失败后,再此成功时,至少有两次被修改了,即modifications 为2

----------------------------------------------------------------
<schedule interval="60">
      <ant anthome="apache-ant-1.7.0" buildfile="cc-build.xml" saveLogDir="projects/${project.name}" antworkingdir="projects/${project.name}"
target="build" />
</schedule> 
当ant节点的antworkingdir属性设定之后,buildfile的起始位置将是  antworkingdir的位置,切记。(ant应用中)ant调用其他文件时,好像也是样的吧,需要查查
-------------------------------------------------------------


4. LabelIncrementer:对源码打标签,自动增加标签的编号

5. Publisher:发布创建的结果,可以通过email的方式通知开发人员()。。。。


IRCPublisher   将结果发入一irc服务器,需要一个 ircPublicsher插件, http://confluence.public.thoughtworks.org/display/CC/IRCPublisher
--------------------------------
当提交的人提交的内容导致了错误,将发送错误消息给他,配置如下:需要注意的一点是,如果cvs用户名是"Paul wei"形式,用户名之间有空格的,CC只提取前面一部分,作为用户名,所以需要加个<map alias="Paul" address="**@**"
/>
    <publishers>
      <onsuccess>
        <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/target/${project.name}.jar" />
      </onsuccess>
   <currentbuildstatuspublisher file="logs/${project.name}/status.txt" />
     <email mailhost="smtp.host"
        returnaddress="admin@smtp.host"
        skipusers="false"
        reportsuccess="fixes"
        subjectprefix="[CruiseControl]"
        buildresultsurl="http://localhost:8080/buildresults/integration"
    >
    <map alias="Paul" address="paul@smtp.host" /> 
             </email>
    </publishers>

至于 config.xml 很多参数,需要参考http://cruisecontrol.sourceforge.net
 


TAG:

 

评分:0

我来说两句

Open Toolbar