“How long would it take your organization to deploy
a change [to the production] that involved just one
single line of code?
Do you do this on a repeatable, reliable basis? ”
Mary and Tom Poppendieck,
Implementing Lean Software Development
精益
持续集成
代码审阅
code push
FFaasstt BBuuiilldd
• Compile
• Unit test
Git/Gerrit
notification
Compile/Build
• Compile
• Unit test
•Quality check
~ 10 min
Packaging
•jar
• rpm
•iso
~ 20 min
Function Test
Function Test
•Smoke test
•Fast test
•Complete test
•Smoke test
•Fast test
•Complete test
~ 4 hours
~ 4 hours
System Testing
System Testing
- weekend
• characters
• stability
~ 1-2 days
- weekend
• characters
• stability
~ 1-2 days
Installation
• iso
•Upgrade
•Uninstall first
~ 30 min
Production
•DemoLab
•Design Env
Production
•DemoLab
•Design Env
•Cloud
•Cloud
持续集成
源代码
Git/Gerrit
测试源代码
二进制构件
3pp
Repository
Package
Repository
Tool
Repository
发布
SSoonnaarr
TTeestsitningg r ereppoortrt
BBuuilidldiningg r ereppoortrt
DDaashshbbooaardrd
反馈系统
Gerrit基本流程
commit
Local
Repository
Local working space
Working
Directory
Gerrit
Code review
system
Remote
repository
gitgit
Gerrit 服务器
提交代码
2
Review Team
3
1
pull
Sync
5
Merge to master
4
Code Review: +2
CI System
3
Verify: +1
4
Node List (A,B,C)
IaaS
Node VM conf
(OpenStack)
(image name, flavor)
Cloud Conf (API) 1. 启动VMs
OOppeennSStatacckk
Package repo
Installation tools
repo
Test Case
repo
二进制构件库
Git
Git
Source code
Git
Installation code
Git
Test case code
源代码库
vm
A
IaaS
(OpenStack)
VM Images
(OS/Base 3pp)
VM information
VM A: 192.0.1.1
VM B: 192.0.1.2
VM C: 192.0.1.3
….
2. 安装最新APP
(DB, Apache/Tomcat)
vm
B
..
vm
A
vm
B
OOppeennSStatacckk
..
vm
A
vm
B
OOppeennSStatacckk
..
3. 功能测试
OOppeennSStatacckk
4. 产生报告
删除VM
云O
penstack
不同产品特性不同用法
From ioslated area (automation, unit level quality) to complete view for CI
开发端用IDE编写代码有项目管理工具,版本控制,单元测试(make/maven/gradle,git、eclipse/intellij,mock)
提交代码,在合并入主干触发持续集成做代码检测 (静态工具),快速测试(动态工具),可以做在线代码审阅 (jenkins,gerrit,sonar)
构建整个产品的代码,打包。(nexus,artifactory)
安装并进行各级测试(策略多种多样)
各种测试报告和及时反馈。(raspeberry pi, dashing,elastic search,kibana)