CruiseControl简介

cruisecontrol、ant、svn持续集成 cruisecontrol、ant、svn持续集成 己两个多星期以来对持续集成的概念和应用有了一些了解。下面主要对自己配置持续集成的环境进行总结。(看上去简单,但是对我开始对持续集成都没什么了解的人来说确实费了不少周折) 立即下载

As usual, the link is:

http://www.javaranch.com/journal/200409/DrivingOnCruiseControl_Part1.html

 

对于这个最著名的CI工具,我已经使用有一段时间了。但是因为有专门的build engineer所以偷懒到今天才来了解一下这个东西的基础知识。

  • 什么是CI和CruiseControl?

要知道CruiseControl的用途,自然得先明白CI是什么。CI, continuous integration。

Technically, the term "Continuous Integration" means that everyone on the team integrates their changes back into the source repository frequently, verifying that the changes didn't break anything.

而集成+测试由完全自动化的工具完成,开发人员需要做的仅仅是将最新的改动提交至repository。CruiseControl就是这样一个自动化工具。

总的来说CI的目的就是实现 快速开发 + 保证质量。在agile越来越流行的今天,CruiseControl会流行就不足为奇了。

再来看官网上一段关于cruisecontrol的说明。有助于加深理解:

CruiseControl is both a continuous integration tool and an extensible framework for creating a custom continuous build process. It includes dozens of plugins for 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 of 3rd Party Tools.

CruiseControl is written in Java but is used on a wide variety of projects. There are builders supplied for Ant, NAnt, Maven, Phing, Rake, and Xcode, and the catch-all exec builder that can be used with any command-line tool or script.

 

  •  How these Continuous Integration servers are typically set up in a project environment?

很简单。


1, Boxes of developer.

2, Box of repository.

3, CruiseControl server.

当开发人员将代码提交到repository时,CruiseControl就能检测到这种变化,build,execute最新的代码并运行UT,最后将结果以web,email等形式呈现给开发人员。另外build时使用的是Ant。其实就是build.xml脚本。

 

  • Setting Up the Repository and Working Copies

这里在repository server上build一个最最简单的repositiry by using Subversion.安装完Subversion后:

1. First, we need to create the repository itself:

C:/> svnadmin create c:/cia/repositoryserver/svnrepository 2. Second,创建一个Subversion自己要用的临时工作目录: 
C:/> mkdir tmp/project C:/> cd tmp/project C:/tmp/project> mkdir branches C:/tmp/project> mkdir tags C:/tmp/project> mkdir trunk //这个trunk看着相当眼熟吧?
3. 把代码copy到trunk目录下。 
4. import the directory structure into our repository: 
svn import C:/tmp/project file:///c:/cia/repositoryserver/svnrepository -m "Initial import" 5.这时可以将tmp/project删除了。之后就可以在程序员的机器上checkout代码了。 
  • Getting, Installing and Building CruiseControl


文章中有关于这几个folder的解释,非常重要。

main/bin --contains a batch/shell script for launching the CruiseControl process

main/logs --放置每个项目build结果的目录。每个项目会有自己的子目录。

main/dist --contains the cruisecontrol.jar

Reporting --contains the J2EE web application used for reporting CruiseControl build results online after each automated build.

  • Configuring CruiseControl

接下来的工作就是配置CruiseControl to tell it which projects it need to build and how.

配置文件是config.xml,下面是一个简介:

config.xml的完全参考是:http://cruisecontrol.sourceforge.net/main/configxml.html#project

<cruisecontrol> root element,可以有 project和plugin子节点。

<project> 多个项目是可以有多个project 节点。The <project> element is where you tell CruiseControl what to build, when to build, how to build, and how to report.

<project> element accepts two attributes. attribute name是project的名字。另一个可选的为buildafterfailed 表示build失败后是否继续build,即使没有新代码提交。

<property>  The <property> element is used to set a property (or set of properties) within the CruiseControl configuration file. 一般可以用project.properties and specific.properties。

<bootstrappers> The <bootstrappers> element can be used to list bootstrappers, which are executed before the actual build attempt.

<modificationset> The <modificationset> element is where you specify how CruiseControl should figure out whether a build is needed。 这个貌似就是报表中显示的这次build涉及的代码的更改。

两个attributes:

requiremodification:如果没有代码改变,是否build

quietperiod:代码改动多长时间内不build,为了给程序员充分的提交代码的时间。

we can use the <svn> modificationset task to check whether any changes have been committed to the project associated with our working copy. Under the hood, the <svn> task performs a 'svn log' command to get a list of changes between the last build date and the start of the current build cycle.

注意这个node仅仅是说,在schedule的时间到了以后,参考该node来决定是否起一次build。而不是说,当发现related svn code改变后,就马上起一个build。

There's also a nice little task named <buildstatus> that you can use to trigger your build whenever another CruiseControlled project has had a successful build.

//这个很有用啊,比如build完这个project以后运行itf build。

<schedule> specifies how frequent you want your build cycle to start.

<schedule> takes just one attribute, interval, which represents a duration in seconds that CruiseControl will wait between build attempts.默认5分钟一次,也太短了吧!!

The children of <schedule> are called builders and are used for specifying the 'how' part of our configuration. The built-in builders provided out of the box, <ant> and <maven>, can be used to launch Ant and Maven build scripts, respectively. 这个也很重要!!

<schedule> 并不能单独决定什么时候启动一个build。需要和比如<project>和<modification>结合起来决定。

<log>

<publishers> 自然就是通知开发人员的方式了。可以有file,email,web pages and FTP

 

配置文件详解:

http://cruisecontrol.sourceforge.net/main/configxml.html

 

通常打开cc的工作目录可以看到以下文件。
-rw-r--r--   1   16004 May  5 02:58 build.xml
-rw-r--r--   1   6892 May  5 02:58 config.xml
-rw-r--r--   1   47171 May  5 03:23 go.log
-rw-r--r--   1   65 May  5 02:58 go.sh
-rw-r--r--   1   1507 May  5 02:58 specific.properties

 

最后,launch CruiseControl!!

With the configuration file in place under "main/bin", you can finally launch CruiseControl with the following command:

C:/CruiseControl/main/bin> cruisecontrol
作者说要写的Part 2没有找到。。。
set up the reporting web application -- in Part 2...
CruiseControl学习 剖析CruiseControl:在没有应用持续集成之前,传统的开发模式是项目一开始就划分模块,然后等所有的代码都开发完成之后再集成到一起进行测试,软件规模也在扩大,软件需求越来越复杂,软件已经不能简单地通过划分模块的方式来开发,需要项目内部互相合作,划分模块这种传统的模式的弊端也越来越明显 立即下载

相关推荐

持续集成及CruiseControl技术交流

主题:持续集成及CruiseControl技术交流 在提升软件质量、降低研发风险、拒绝浪费方面,处于敏捷实践领域的持续集成(Continuous Integration,CI)起到重要作用。持续集成能够解决研发工作中的80%任务(日常),而剩下的20%任务(非日常)需要研发团队智力劳动的付出。 CI需要整个团队的配合,我们不能够把CI看成是单纯的技术实践。更多地,它是一种研发模式的转变。CruiseControl是一著名的CI服务器。本次交流会从零介绍它的使用,并附带大量的Demo演示。 注意,持续集成本身也是一持续改进的过程。如何逐渐提升可回归性、敏捷性,这是一个永恒的话题。 适合群体 具有一定的软件研发经验 熟悉研发工作生命周期中的各个阶段 对持续集成感兴趣的人士

CruiseControl配置详解

将下载好的cruisecontrol-bin-2.8.4.zip解压后,目录结构如下图所示:

闸北米 3068

cruisecontrol简介

cruisecontrol简介

持续集成工具CC介绍

CruiseControl:简称CC,持续集成工具,主要提供了基于版本管理工具(如CVS)感知变化或每天定时的持续集成,并提供持续集成报告、Email、Jabber等等方式通知相关负责人,其要求是需要进行日构建的项目已编写好全自动的项目编译脚本(可基于Maven或Ant)。在这里以一个项目来简要的说说cc的使用,通常项目对于日构建的类型的需求分为两种:1、每天的定时自动集成。2、感知版本管理工具中

3140

项目部署发布CruiseControl工具介绍

一.什么是持续化集成 什么是持续化集成?它对我们的日常工作有什么样的帮助?敏捷已经是一个非常热门的话题,它高效的工作方式和快速的需求应对能力,赢得了很多中小软件厂商的关注。那么敏捷除了一些经常谈论到编程思维和迭代的开发模式等,其实还部分依赖于好的改善工作流程的工具。持续化集成工具便是服务于敏捷软件开发的一个系列。它主要将原本分散,无序的工作流程,通过工具软件有机的组织起来,并且在组织的过程中,参与开发、设计、测试的各个部门的人员都能从中获取到自动化方面的便利。使得团队的工作效率大大提升。 二.Cruis

cug-jdc的博客 1372

CruiseControl入门简介

CruiseControl是一种持续集成过程的框架,包括了邮件通知,ant和各种源码控制工具的插件。并提供了web接口,用于查看当前和以前的创建的结果。下面将用CC来代表CruiseControl。 首先来安装运行一个CC自带的示例: 1.  CC下载 下载地址:http://cruisecontrol.sourceforge.net/ 2.  CC安装成功后,目录结构如下 CC

Quincylk的专栏 3223

cruisecontrol的搭建和使用

== cruisecontrol == === cruisecontrol的介绍 === {{{ CruiseControl :简称 CC ,持续集成工具,主要提供了基于版本管理工具 ( 如 CVS、VSS、SVN) 感知变化或每天定时的持续集成,并提供持续集成报告、 Email 、 Jabber 等等方式通知相关负责人,其要求是需要进行日构建的项目已编写好全自动的项目编译脚本 ( 可基于

啵啵伯尼的专栏 804

CruiseControl简介及使用举例

CruiseControl简介及使用举例

风之影 226

CruiseControl 安装和启动

  一CruiseControl安装0)安装Java SDK,然后设置JAVA_HOME环境变量。 1)下载解压,例如2.8.3版本:http://sourceforge.net/projects/cruisecontrol/files/CruiseControl/2.8.3/。 2)使用cruisecontrol.bat 或 cruisecontrol.sh 来启动CruiseContr...

llove302896000的专栏 392

搭建CruiseControl 环境

转自:http://blog.csdn.net/tony1130/archive/2008/01/13/2041968.aspx官方网站:http://cruisecontrol.sourceforge.net/main/configxml.html搭建你的持续集成服务器 CruiseControl是一个不错的持续集成服务器,不过国内社区的普遍反应是:它的配置太麻烦,无从下手。从本篇文章开始,我将

圣彼得堡之光的专栏 2599

[CruiseControl] 概念

一  CruiseControl CruiseControl既是一个Continous integration工具,也是一个创建自定义的Continous build process的框架。 cruisecontrol被设置高度可扩展,可以使用plugin对cruisecontrol的功能无限扩展。目前它已经包含非常多的plugins,例如与source control的交互, 各种build ...

weixin_34211761的博客 140

CruiseControl使用总结

CruiseControl:简称CC,持续集成工具,主要提供了基于版本管理工具(如SVN)感知变化或每天定时的持续集成, 并提供持续集成报告,通过Email、IM、RSS等等方式通知相关负责人。 使用CruiseControl的优点 持续集成最大的优点是可以避免传统模式在集成阶段的除虫会议(bug meetings)。 降低风险,尽早的发现bug,静态代码分析 自动化,自动编译、自动测试...

laughing 332

CruiseControl持续集成

  1.           认识CruiseControl CruiseControl是CI服务器的老者,诞生已是多年,在许多方面,CruiseControl服务器已经成为持续集成实践的同义词。而现在,CruiseControl已发展成为一个家族式系统,包括CruiseControl.java、CruiseControl.net、CruiseControl.ruby等适应不同语言环境的实现,其...

wanyway的专栏 347

CruiseControl概述

<br />CruiseControl<br /><br />1  CruiseControl概述<br /><br />1.1  什么是CruiseControl<br />CruiseControl(以下简称cc)是一个持续集成的框架,它包括邮件通知,ant和其他源码控制工具等插件。cc的web接口可以提供浏览项目当前和之前的构建情况的界面。<br /><br /><br />1.2  什么是持续集成<br />持续集成最先由Martin Fowler和Matthew Foemmel提出。软件获得成功的

zzqyun的专栏 898

CruiseControl 小结

持续集成(Continuous Integration)可能对不熟悉自动化测试的部分人来说是一个新鲜词,然而它在软件开发,特别是大型的开发任务过程中,正在发挥越来越大的作用。软件开发为了保证代码的稳定和可用,测试是必不可少的,没有哪个公司和个人敢说自己的代码100%没有BUG。在软件测试这一块,很多企业是招专门的测试工程师进行人工测试。人工测试有自己的特有的优点,但自动化测试也有自己的好的一面。1)节约测试的人力成本2)测试点全面,可能人有时候会忘记要对哪些点做测试,但机器不会忘记。3)如果代码有BUG,它

yousuf007的专栏 1139

CruiseControl使用笔记——01.Ready

------------------------------------------------------------------------------------- 参考: http://www.ibm.com/developerworks/cn/java/j-ap09056/ -------------------------------------------------------...

Love Cafe, Love Java 165
上一篇: 反射reflection
下一篇: Mock object and EasyMock framework
OnlyQi
博客等级 码龄16年 70粉丝 283原创
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值