CI/CD 管道 是一个 自动化的阶段序列,代码通过它从 commit 到 deployment — 通常包括 build、test 和 deploy 步骤。它定义了自动化路径,将代码变更转变为已部署的发布版本。
管道概念
A PIPELINE is an automated workflow of STAGES that run in sequence on each code change:
→ triggered by an event (a push, a PR, a merge, a schedule)
→ each stage runs automatically; if a stage FAILS, the pipeline STOPS (broken code
doesn't proceed to later stages or production)
→ provides automation, consistency, and fast feedback
典型的管道阶段
1. SOURCE → triggered by a code change (checkout the code)
2. BUILD → compile the code, install dependencies, build artifacts/images
3. TEST → run automated tests (unit, integration), linting, static analysis
4. (SECURITY) → security scans (dependencies, code, container images)
5. PACKAGE → create deployable artifacts (e.g. a Docker image pushed to a registry)
6. DEPLOY to STAGING → deploy to a test/staging environment; run further tests (e2e)
7. DEPLOY to PRODUCTION → release to production (manual approval for delivery, or
automatic for deployment)
→ Each stage gates the next: failures stop the pipeline (quality gates).
