Skip to content

CI/CD

一句话解释

CI/CD 是练习的 automatically 构建, 测试, and deploying code 每个时间更改是 pushed.

用大白话说

CI/CD stands for Continuous Integration and Continuous Delivery (or Deployment). It is an automated pipeline that takes your code from a commit all the way to production without manual intervention.

Continuous Integration (CI) means every time a developer pushes code, it is automatically merged and tested. This catches bugs early because tests run on every change, not just before release.

Continuous Delivery (CD) means the code is always in a deployable state — it is built, tested, and packaged automatically. Continuous Deployment goes one step further: every change that passes tests is automatically deployed to production.

Think of it like a factory assembly line: raw code goes in one end, tests run in the middle, and a working application comes out the other end — all automatically.

示例

yaml
# GitHub Actions CI/CD example
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: npm install
      - run: npm test
      - run: npm run build

每个推送触发流水线: checkout code, 安装 dependencies, 运行测试, and 构建项目.

工作原理

  1. Developer pushes code to the repository.
  2. CI stage: the pipeline builds the code and runs automated tests.
  3. If tests pass, CD stage: the code is packaged into an artifact.
  4. The artifact is deployed to a staging or production environment.
  5. If any step fails, the pipeline stops and alerts the team.

常见混淆

  • 容易混淆的对象: Continuous Delivery

    关键区别: Continuous Delivery 需要 manual approval 到部署; Continuous 部署部署 automatically 之后测试通过.

相关术语

解读错误信息

用大白话解释常见错误——什么意思、为什么发生、如何修复。

查看错误

← 返回术语表