Skip to Content
Java持续交付
book

Java持续交付

by Daniel Bryant, Abraham Marín-Pérez
November 2019
Beginner to intermediate
406 pages
9h 21m
Chinese
Publishing House of Electronics Industry
Content preview from Java持续交付
178
9
持续集成:创建构建管道的第一步
在本章中,你将学习如何实现持续集成(
CI
)。你会了解到
CI
为什么如此重要,以及有
关版本控制系统(
VCS
)的基础内容。你还将学习分布式
VCS Git
的基本使用方法,以
及如何组织团队来使用该工具。关于代码审查的话题可能会有些难度,但是你会了解它
的一些关键好处,以及如何开展代码审查。本章介绍的最后一个内容是自动化的
CI
构建。
为什么要持续集成
持续集成
CI
)指的是我们经常将新的或者改动后的代码,集成到已有的代码仓库中,
同时将所有本地的开发代码,定期合并到一个共享的主线或者主干(
trunk
)分支中。这
里对“定期”没有固定的定义,但要想真正实践
CI
,应该是一天几次。一个广为接受的
最佳实践,是当每次代码被提交到共享代码仓库时,都触发一次构建,并安排定期的“夜
间”构建,以便发现因为外部系统变更或者一些无法控制的问题而导致的集成问题(例
,在某个依赖服务中发现一个新的安全漏洞)。
CI
的主要目的是防止出现集成问题,它们在极限编程(
XP
)的早期发展中被称为
集成
地狱
。在
XP
中,
CI
其实是为了与测试驱动开发(
TDD
)的自动化单元测试结合使用的。
在完成一系列
TDD
的编码工作以后,你通常会在本地环境中运行所有的单元测试,以
便在将新代码提交到主线之前,验证它们是否全部通过测试。通过定期提交代码,每个
开发人员都可以减少代码冲突的可能,也有助于减少自己的代码无意中破坏了他人代码
的情况。
在如今的
CI
中,开发团队通常会使用构建服务器来完成构建、自动化测试、验证这一
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
Java性能优化实践:JVM调优策略、工具与技巧

Java性能优化实践:JVM调优策略、工具与技巧

Benjamin J. Evans, James Gough, Chris Newland
Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

Posts & Telecom Press, Nitin Hardeniya
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787121374425