I07 · CI-CD & 部署 詳細 ROADMAP

計畫文件,不會被 Quartz 渲染。 回主 roadmap → infra/ROADMAP.md


章節目標

從 code 到 production 的流水線。本章處理 CI/CD pipeline 設計、IaC、GitOps、Deployment Strategy、多環境 promotion。這些是平台工程師的主場——backend 工程師只需「讀得懂」(見 backend/deployment/ B18 #18),深入規劃運維在這。


🌱 基本介紹

#主題SlugStage大綱
01CI-CD 全景01-cicd-landscape🌱Git → Build → Test → Scan → Push → Deploy 完整 pipeline;每階段責任

❓ 為什麼需要

#主題SlugStage大綱
02為什麼 CI Pipeline 必含 lint + test + scan02-why-cicd-must-have-quality-gates🌱缺哪一環就對應的問題進 prod;pipeline 就是自動化 gatekeeper
03為什麼要 IaC 不要 ClickOps03-why-iac-over-clickops🌱手動點 console 不可重現、審計不完整、新人 onboarding 痛
04為什麼 Zero-downtime Deploy 不是可選04-why-zero-downtime🌱金流 / 電商 / 24/7 service 掛 1 分鐘 = 損失;鋪天蓋地的需求
05為什麼 GitOps 值得投入05-why-gitops🌱Git 作 source of truth / declarative / 自動 sync / audit trail

🕰️ 演進

#主題SlugStage大綱
06CI-CD 核心演進⛔️ infra/cicd-deployment/05-infra-core-cicd🌿跨系列
07Git CI 流程演進⛔️ infra/cicd-deployment/06-git-ci-release🌿跨系列
08CI-CD 演進驅動力08-cicd-evolution-drivers🌱Jenkins 自架 plugin 噩夢撞牆 → GitHub Actions / GitLab CI 託管;YAML pipeline 難維護撞牆 → Dagger(code-as-pipeline);手動部署撞牆 → Argo CD / Flux GitOps;IaC 單向撞牆 → Crossplane / control plane 化

🧠 知識型

F07-A CI Pipeline 設計

#主題SlugStage大綱
09CI 核心⛔️ infra/cicd-deployment/05-infra-core-cicd🌿跨系列
10Git CI 釋出流程⛔️ infra/cicd-deployment/06-git-ci-release🌿跨系列
11CI/CD 平台全景選型11-cicd-platform-selection🌱Jenkins / GitLab CI / GitHub Actions / Buildkite / Dagger / CircleCI / Drone / Argo Workflows 全景對比:host 模式(自架 vs SaaS)、pipeline 語言(YAML vs code-as-pipeline)、執行引擎(K8s-native vs runner)、價格 / 適用規模。為什麼還有人留在 Jenkins、為什麼小團隊直上 GHA、為什麼 Dagger 是未來
12GitLab CI/CD 模板⛔️ infra/cicd-deployment/08-gitlab-cicd-templates🌿跨系列
13GitHub Actions 進階13-github-actions-deep🌱reusable workflow / composite action / OIDC / matrix / secret 管理
14微服務 CI/CD(吸收 micro-service/48)⛔️ backend/micro-service/48-cicd-microservice🌿跨系列
15CI/CD Per Service(吸收 backend B08 #40)15-cicd-per-service-ops🌱從 backend 吸收:Monorepo vs Multirepo;selective build;image tagging
16Pipeline Runner 運維16-runner-ops🌱Self-hosted runner;scaling;資源隔離;K8s runner(ARC)

F07-B IaC(Infrastructure as Code)

#主題SlugStage大綱
17IaC 基礎⛔️ infra/cicd-deployment/31-infrastructure-as-code🌿跨系列
18Terraform 深入18-terraform-deep🌱State management(remote backend / locking);module 設計;CI/CD 整合
19Pulumi / CDK / Crossplane 選型19-iac-alternatives🌱用 general language vs HCL;Crossplane K8s-native 方向
20Ansible / Salt(config management)20-config-management🌱還有市場嗎?地端 fleet 管理場景

F07-C 發布策略

#主題SlugStage大綱
21Rolling / Blue-Green / Canary 深入21-deployment-strategies-deep🌱每種策略的 infra 層機制;跟 management/engineering-process/08-release-methodology/01 分工
22Zero-downtime Deploy 實戰(吸收 micro-service/49)⛔️ backend/micro-service/49-zero-downtime-deploy🌿跨系列
23Progressive Delivery(Argo Rollouts / Flagger)23-progressive-delivery🌱Canary 自動化;SLO-based rollback;跟 I05 SLO 連動
24Feature Flag 跟部署的配合24-feature-flag-deploy🌱Decoupling deploy from release;infra 視角的 FF(部署時機 vs 功能開關)

F07-D GitOps

#主題SlugStage大綱
25K8s GitOps⛔️ infra/k8s/08-k8s-gitops🌿跨系列
26Argo CD 深入26-argocd-deep🌱App of Apps / ApplicationSet / Sync wave / health check
27Flux 深入27-flux-deep🌱Helm / Kustomize 整合;multi-tenancy;跟 Argo CD 選型
28Helm / Kustomize / Timoni 選型28-k8s-config-tools🌱各自哲學;2026 新玩家(Timoni / CUE-based)

F07-E 環境 & Promotion

#主題SlugStage大綱
29環境分離⛔️ infra/cicd-deployment/25-environment-separation🌿跨系列
30多環境 Promotion 策略30-multi-env-promotion🌱dev → staging → prod;同 artifact 跨環境;跟 GitOps 整合
31Ephemeral Environment(per-PR)31-ephemeral-env🌱Vercel / Railway / Render 類模式自架;K8s namespace per-PR

F07-F Image Registry & Supply Chain

#主題SlugStage大綱
32Image Registry 運維⛔️ infra/compute/07-container-registry🌿跨系列
33SBOM / Signed image 在 CI 整合33-sbom-signing-ci🌱本章聚焦 CI pipeline 怎麼串 signing:cosign CLI / Sigstore GitHub Actions / Binary Authorization deploy policy;image 本身的 signing 鏈 + SLSA provenance 見 infra/compute/ I03 14-15

🔧 小實作注意事項

#主題SlugStage大綱
34從零寫 GitHub Actions pipeline34-github-actions-from-scratch🌱lint + test + scan + build + push + deploy;reusable workflow
35本機 Argo CD demo35-argocd-demo🌱Kind cluster + Argo CD + sample app;GitOps workflow 實作
36Terraform module 從零建36-terraform-module-scratch🌱寫 VPC / EKS module;state 管理;testing with terratest

💣 Anti-pattern

#主題SlugStage大綱
37CI-CD Anti-patterns37-cicd-antipatterns🌱Pipeline 沒含 lint + test;用 latest tag;CI 時效 30+ 分鐘;Long-lived token;deploy 靠手動 kubectl;沒 rollback 計畫;多 cluster 手動 sync;Terraform state 沒 lock

🧰 對應檢查工具

#主題SlugStage大綱
38CI-CD 工具38-cicd-tooling🌱GitHub Actions / GitLab CI / Jenkins / Buildkite / Dagger;Terraform / Pulumi / Crossplane;Argo CD / Flux / Argo Rollouts;Helm / Kustomize / Timoni

📎 補充

#主題SlugStage大綱
S01好的 CI/CD Pipeline 體檢⛔️ common/quality/standards/06-good-cicd-pipeline🌿跨系列
S02從 Jenkins 遷到 GitHub Actions 路徑s02-jenkins-to-gha-migration🌱實戰遷移策略;共存期;跨團隊 rollout

章節進度統計

  • 知識主題:38 + 2 補充 = 40 項(2026-04 新增 #11 CI/CD 平台全景選型)
  • 🌿 growing:7(既有 infra/ + pointer)
  • 🌱 seed:33

跨系列連結

  • infra/cicd-deployment/05, 06, 08, 25, 31(原始 CI-CD 篇)
  • infra/k8s/08-k8s-gitops
  • infra/compute/07-container-registry
  • backend/deployment/ B18 17-18(已 pointer 到本章)
  • backend/architecture/ B08 #40 CI-CD per service(已 pointer)
  • backend/micro-service/48-49(microservice CI/CD / zero-downtime)
  • management/engineering-process/08-release-methodology/01
  • common/quality/standards/06-good-cicd-pipeline
  • infra/cloud/aws/10-aws-cicd(雲端 CI/CD 實作)
  • → I03 Compute(部署目標)
  • → I06 Security(pipeline 中 security scanning)