持续集成(Continuous integration)

流程

当对代码进行变更,开发人员取得当前基础代码的一份拷贝。当其他开发人员提交变更的代码到代码库里时,这份拷贝将逐渐与版本库里的最新代码间产生差异。不仅现存的代码基础发生了变化,而且随着新的代码、库文件和其它资料的添加,其中的依赖和潜在的冲突也随之出现。

一个分支检出的时间越长,当开发分支重新整合到主线上的时候,整合的冲突和失败的风险就越大。在开发人员向代码库进行提交之前,他们必须更新代码来获得至取得代码副本以来版本库的变更。版本库里包含越多的变更,开发人员在提交代码之前做的工作就会越多。

最终,代码库与开发者的基线将产生巨大的差异,这种情况有时被称为“合并地狱”或者“整合地狱”,在这种情况下,合并所需要的时间将超过作出变更所花费的时间。持续集成要求尽早的合并并且经常合并,从而避开“整合地狱”陷阱。这样做的目的是减少重复工作从而达到节约时间和成本的目的。

在提交工作之前,其余的CI步骤为编程人员做一次完整的编译,跑过所有的单元测试。集成测试通常自动运行在CI服务器上在其侦测到一次提交后。

最佳实践

1 维护代码库

2 自动编译

3 自动测试

4 每天每一名开发人员都向基线提交

5 每次对基线的提交都应该被构建

6 保持编译的快速

7 在产品环境下进行测试

8 使得获取最新的提交更加容易

9 每个人都能看到最新的编译结果

10 自动部署

来源:https://en.wikipedia.org/wiki/Continuous_integration

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Title: Jenkins Continuous Integration Cookbook, 2nd Edition Author: Alan Mark Berg Length: 360 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2015-01-29 ISBN-10: 1784390089 ISBN-13: 9781784390082 Over 90 recipes to produce great results from Jenkins using pro-level practices, techniques, and solutions About This Book Explore the use of more than 40 best-of-breed plug-ins for improving efficiency Secure and maintain Jenkins by integrating it with LDAP and CAS, which is a Single Sign-on solution Step-by-step, easy-to-use instructions to optimize the existing features of Jenkins using the complete set of plug-ins that Jenkins offers Who This Book Is For If you are a Java developer, a software architect, a technical project manager, a build manager, or a development or QA engineer, then this book is ideal for you. A basic understanding of the software development life cycle and Java development is needed, as well as a rudimentary understanding of Jenkins. In Detail Jenkins is an award-wining and one of the most popular Continuous Integration servers in the market today. It was designed to maintain, secure, communicate, test, build, and improve the software development process. This book starts by examining the most common maintenance tasks. This is followed by steps that enable you to enhance the overall security of Jenkins. You will then explore the relationship between Jenkins builds and Maven pom.xml. Then, you will learn how to use plugins to display code metrics and fail builds to improve quality, followed by how to run performance and functional tests against a web application and web services. Finally, you will see what the available plugins are, concluding with best practices to improve quality. Table of Contents Chapter 1: Maintaining Jenkins Chapter 2: Enhancing Security Chapter 3: Building Software Chapter 4: Communicating through Jenkins Chapter 5: Using Metrics to Improve Quality Chapter 6: Testing Remotely Chapter 7:

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值