# 持续集成

持续集成指的是，频繁地（一天多次）将代码集成到主干。

![img](https://3031472641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAr2Be4dyt9wCNUgU_3%2Fuploads%2Fgit-blob-c5bb486ee42e5bfc40594b807c253b9594092ddc%2Fc5c8e6f40c7c133e22402c00bb7e1a25_720w.jpg?alt=media)

持续集成强调开发人员提交了新代码之后，立刻进行构建、（单元）测试。根据测试结果，我们可以确定新代码和原有代码能否正确地集成在一起。

## 持续交付

![img](https://3031472641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAr2Be4dyt9wCNUgU_3%2Fuploads%2Fgit-blob-74ab729afaae686debc0a24e23b6058ec6834d26%2Fdb7198e3c39e4656e18efcb4bd1b20b1_720w.jpg?alt=media)

**持续交付（Continuous delivery）指的是，频繁地将软件的新版本，交付给质量团队或者用户，以供评审。**

持续交付在持续集成的基础上，将集成后的代码部署到更贴近真实运行环境的「类生产环境」（*production-like environments*）中。比如，我们完成单元测试后，可以把代码部署到连接数据库的 Staging 环境中更多的测试。如果代码没有问题，可以继续手动部署到生产环境中。

## 持续部署

**持续部署（continuous deployment）是持续交付的下一步，指的是代码通过评审以后，自动部署到生产环境。**

![img](https://3031472641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAr2Be4dyt9wCNUgU_3%2Fuploads%2Fgit-blob-e06071090caf630a34fe8bd3aa94ac94ea903507%2Ff96f19e4d567aad5006d841963a86e41_720w.jpg?alt=media)

持续部署则是在持续交付的基础上，把部署到生产环境的过程自动化。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bing.gitbook.io/phper/notes/kai-fa-liu-cheng/chi-xu-ji-cheng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
