持续集成(CI)- 基础

持续集成(Continuous Integration)在多人的项目中有很重要的作用,本次把这方面的知识归总一下,为相关的实践提供一些参考。

CI定义和优点

参考大师的定义: http://www.martinfowler.com/articles/continuousIntegration.html

持续集成作为一个很好的开发实践,主要有如下方面的一些价值:

  • 减少风险
  • 减少重复过程
  • 在任何实践、任何地点生成可部署的软件
  • 增强项目的可见性
  • 对开发团队的软件产品建立起更强大的产品信息

CI的开发流程

1  从代码管理器签出源文件

2  修改代码

3  编译代码

4  遇到错误,转到2继续修改直到达到预期

5  运行单元测试,期望所有的测试绿色(通过)

6  单元测试出错,转入2

7  重构代码,按照规范增强可读性,转入2

8  完成后签入代码

9  CI服务器监控到变化,自动获取代码

10  CI服务器自动编译代码

11  CI服务器运行单元测试、规范检查、集成测试等各种测试

12  CI服务器进行反馈,使相关人员知道构建状态,然后进行修改或继续

CI的Build类型

Build类型

用途

Continuous/Incremental

Runs when code is checked in. Does a quick compile and unit test.

Daily/Nightly

Does a compile and full suite of unit tests and possibly additional testing such as FitNesse.

Weekly

Does a compile, full unit testing, and additional testing such as FitNesse.

Release

Creates an install set and then runs and tests the inst all process.

QA

Creates a build just for the QA team.

Staging

Builds and copies assemblies to a staging server.

posted @ 2011-06-15 12:52  2012  阅读(2393)  评论(0编辑  收藏  举报