
文章目录
- [软件开发模型系列(八):DevOps ------ 打破"我电脑上是好的"这道墙](#软件开发模型系列(八):DevOps —— 打破"我电脑上是好的"这道墙)
- [1、什么是 DevOps](#1、什么是 DevOps)
- [2、DevOps 的诞生:从"甩锅墙"说起](#2、DevOps 的诞生:从"甩锅墙"说起)
- [3、DevOps 的里程碑事件](#3、DevOps 的里程碑事件)
- [4、DevOps 的三条道路(The Three Ways)](#4、DevOps 的三条道路(The Three Ways))
-
- 4.1、第一道:流动(Flow)------加快从左到右的流速
- 4.2、第二道:反馈(Feedback)------建立从右到左的反馈
- [4.3、第三道:持续学习与实验(Continual Learning)](#4.3、第三道:持续学习与实验(Continual Learning))
- [5、CI/CD:DevOps 的核心技术落地](#5、CI/CD:DevOps 的核心技术落地)
-
- [5.1、CI/CD 从哪来:同样是被"集成地狱"逼出来的](#5.1、CI/CD 从哪来:同样是被"集成地狱"逼出来的)
- 5.2、一条演进时间线
- [5.3、用扫地机器人理解 CI/CD](#5.3、用扫地机器人理解 CI/CD)
- 5.4、常见工具速览
- [6、为什么 DevOps 不是"招一个 DevOps 工程师"就能解决的](#6、为什么 DevOps 不是"招一个 DevOps 工程师"就能解决的)
- [7、DevOps 与 AI 时代](#7、DevOps 与 AI 时代)
- 8、本篇要点速记
- [9、You build it, you run it 的疑惑](#9、You build it, you run it 的疑惑)
软件开发模型系列(八):DevOps ------ 打破"我电脑上是好的"这道墙
敏捷解决了"开发怎么应对变化"的问题,但它停在了一个尴尬的地方:代码写完了,测试通过了------然后呢?扔给运维,撒手不管。DevOps 要解决的,正是这最后一步的断裂。
1、什么是 DevOps

DevOps 是 Development(开发) 和 Operations(运维) 的合成词。它首先是一场文化运动,其次才是一套工具链和实践方法。
它的核心主张只有一句话:
"You build it, you run it." ------ 谁开发,谁负责上线和维护。
这句话看起来简单,但它颠覆了传统 IT 组织数十年的分工逻辑。

2、DevOps 的诞生:从"甩锅墙"说起
在 DevOps 出现之前,软件公司的组织结构大致是这样的:
#mermaid-svg-PVHmbeQffYaHg689{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-PVHmbeQffYaHg689 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-PVHmbeQffYaHg689 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-PVHmbeQffYaHg689 .error-icon{fill:#552222;}#mermaid-svg-PVHmbeQffYaHg689 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-PVHmbeQffYaHg689 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-PVHmbeQffYaHg689 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-PVHmbeQffYaHg689 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-PVHmbeQffYaHg689 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-PVHmbeQffYaHg689 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-PVHmbeQffYaHg689 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-PVHmbeQffYaHg689 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-PVHmbeQffYaHg689 .marker.cross{stroke:#333333;}#mermaid-svg-PVHmbeQffYaHg689 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-PVHmbeQffYaHg689 p{margin:0;}#mermaid-svg-PVHmbeQffYaHg689 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-PVHmbeQffYaHg689 .cluster-label text{fill:#333;}#mermaid-svg-PVHmbeQffYaHg689 .cluster-label span{color:#333;}#mermaid-svg-PVHmbeQffYaHg689 .cluster-label span p{background-color:transparent;}#mermaid-svg-PVHmbeQffYaHg689 .label text,#mermaid-svg-PVHmbeQffYaHg689 span{fill:#333;color:#333;}#mermaid-svg-PVHmbeQffYaHg689 .node rect,#mermaid-svg-PVHmbeQffYaHg689 .node circle,#mermaid-svg-PVHmbeQffYaHg689 .node ellipse,#mermaid-svg-PVHmbeQffYaHg689 .node polygon,#mermaid-svg-PVHmbeQffYaHg689 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-PVHmbeQffYaHg689 .rough-node .label text,#mermaid-svg-PVHmbeQffYaHg689 .node .label text,#mermaid-svg-PVHmbeQffYaHg689 .image-shape .label,#mermaid-svg-PVHmbeQffYaHg689 .icon-shape .label{text-anchor:middle;}#mermaid-svg-PVHmbeQffYaHg689 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-PVHmbeQffYaHg689 .rough-node .label,#mermaid-svg-PVHmbeQffYaHg689 .node .label,#mermaid-svg-PVHmbeQffYaHg689 .image-shape .label,#mermaid-svg-PVHmbeQffYaHg689 .icon-shape .label{text-align:center;}#mermaid-svg-PVHmbeQffYaHg689 .node.clickable{cursor:pointer;}#mermaid-svg-PVHmbeQffYaHg689 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-PVHmbeQffYaHg689 .arrowheadPath{fill:#333333;}#mermaid-svg-PVHmbeQffYaHg689 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-PVHmbeQffYaHg689 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-PVHmbeQffYaHg689 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-PVHmbeQffYaHg689 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-PVHmbeQffYaHg689 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-PVHmbeQffYaHg689 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-PVHmbeQffYaHg689 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-PVHmbeQffYaHg689 .cluster text{fill:#333;}#mermaid-svg-PVHmbeQffYaHg689 .cluster span{color:#333;}#mermaid-svg-PVHmbeQffYaHg689 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-PVHmbeQffYaHg689 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-PVHmbeQffYaHg689 rect.text{fill:none;stroke-width:0;}#mermaid-svg-PVHmbeQffYaHg689 .icon-shape,#mermaid-svg-PVHmbeQffYaHg689 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-PVHmbeQffYaHg689 .icon-shape p,#mermaid-svg-PVHmbeQffYaHg689 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-PVHmbeQffYaHg689 .icon-shape .label rect,#mermaid-svg-PVHmbeQffYaHg689 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-PVHmbeQffYaHg689 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-PVHmbeQffYaHg689 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-PVHmbeQffYaHg689 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-PVHmbeQffYaHg689 .stage>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-PVHmbeQffYaHg689 .stage span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-PVHmbeQffYaHg689 .stage tspan{fill:#1e3a8a!important;}#mermaid-svg-PVHmbeQffYaHg689 .pain>*{fill:#fee2e2!important;stroke:#dc2626!important;stroke-width:1px!important;color:#7f1d1d!important;}#mermaid-svg-PVHmbeQffYaHg689 .pain span{fill:#fee2e2!important;stroke:#dc2626!important;stroke-width:1px!important;color:#7f1d1d!important;}#mermaid-svg-PVHmbeQffYaHg689 .pain tspan{fill:#7f1d1d!important;} 开发团队
写代码,目标:快速上线新功能
🧱 墙:代码扔过去,沟通靠工单、信息靠文档
测试团队
验证功能,目标:保证质量
🧱 墙
运维团队
管服务器,目标:系统稳定别出事
这三拨人的利益天然冲突:
text
开发: "我要上线新版本!"
测试: "还没测完,不能上!"
运维: "上次上线崩了,这次谁敢批?"
出现线上故障时:
开发: "我电脑上是好的呀。"
运维: "服务器上跑崩了。"
开发: "那肯定是环境问题,不是我的代码问题。"
运维: "......"
这就是 Patrick Debois(DevOps 运动的核心发起人)形容的 "Wall of Confusion"(混乱之墙)。
3、DevOps 的里程碑事件
DevOps 不像 Scrum 那样有一份正式的宣言,它是通过一系列关键事件自然生长出来的:
| 时间 | 事件 |
|---|---|
| 2007 | 比利时系统管理员 Patrick Debois 在一个政府数据中心迁移项目中深刻体会到开发-运维协作的痛 |
| 2008 | Debois 在 Agile Conference 上认识了 Andrew Shafer,两人成立了 Agile System Administration Group |
| 2009.06 | Flickr 的 John Allspaw 和 Paul Hammond 在 Velocity Conference 发表著名演讲:"10+ Deploys Per Day: Dev and Ops Cooperation at Flickr"。Debois 在比利时远程观看直播,深受震撼 |
| 2009.10 | Debois 在比利时根特组织了全球首届 DevOpsDays 大会。为了 Twitter 话题标签的长度,他把 DevOpsDays 缩写成 #DevOps------这个词从此诞生 |
| 2013 | Gene Kim 等人出版 《The Phoenix Project》(凤凰项目),用商业小说的形式介绍 DevOps 理念,成为现象级畅销书 |
| 2016 | Gene Kim、Jez Humble、Patrick Debois、John Willis 合著 《The DevOps Handbook》,提供了实践层面的完整指南 |
4、DevOps 的三条道路(The Three Ways)

《凤凰项目》中提出了 DevOps 的"三条道路",这是理解 DevOps 最清晰的框架:
4.1、第一道:流动(Flow)------加快从左到右的流速
#mermaid-svg-0O0OWZzoRsmz1kdB{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-0O0OWZzoRsmz1kdB .error-icon{fill:#552222;}#mermaid-svg-0O0OWZzoRsmz1kdB .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-0O0OWZzoRsmz1kdB .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-0O0OWZzoRsmz1kdB .marker{fill:#333333;stroke:#333333;}#mermaid-svg-0O0OWZzoRsmz1kdB .marker.cross{stroke:#333333;}#mermaid-svg-0O0OWZzoRsmz1kdB svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-0O0OWZzoRsmz1kdB p{margin:0;}#mermaid-svg-0O0OWZzoRsmz1kdB .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-0O0OWZzoRsmz1kdB .cluster-label text{fill:#333;}#mermaid-svg-0O0OWZzoRsmz1kdB .cluster-label span{color:#333;}#mermaid-svg-0O0OWZzoRsmz1kdB .cluster-label span p{background-color:transparent;}#mermaid-svg-0O0OWZzoRsmz1kdB .label text,#mermaid-svg-0O0OWZzoRsmz1kdB span{fill:#333;color:#333;}#mermaid-svg-0O0OWZzoRsmz1kdB .node rect,#mermaid-svg-0O0OWZzoRsmz1kdB .node circle,#mermaid-svg-0O0OWZzoRsmz1kdB .node ellipse,#mermaid-svg-0O0OWZzoRsmz1kdB .node polygon,#mermaid-svg-0O0OWZzoRsmz1kdB .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-0O0OWZzoRsmz1kdB .rough-node .label text,#mermaid-svg-0O0OWZzoRsmz1kdB .node .label text,#mermaid-svg-0O0OWZzoRsmz1kdB .image-shape .label,#mermaid-svg-0O0OWZzoRsmz1kdB .icon-shape .label{text-anchor:middle;}#mermaid-svg-0O0OWZzoRsmz1kdB .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-0O0OWZzoRsmz1kdB .rough-node .label,#mermaid-svg-0O0OWZzoRsmz1kdB .node .label,#mermaid-svg-0O0OWZzoRsmz1kdB .image-shape .label,#mermaid-svg-0O0OWZzoRsmz1kdB .icon-shape .label{text-align:center;}#mermaid-svg-0O0OWZzoRsmz1kdB .node.clickable{cursor:pointer;}#mermaid-svg-0O0OWZzoRsmz1kdB .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-0O0OWZzoRsmz1kdB .arrowheadPath{fill:#333333;}#mermaid-svg-0O0OWZzoRsmz1kdB .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-0O0OWZzoRsmz1kdB .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-0O0OWZzoRsmz1kdB .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0O0OWZzoRsmz1kdB .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-0O0OWZzoRsmz1kdB .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0O0OWZzoRsmz1kdB .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-0O0OWZzoRsmz1kdB .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-0O0OWZzoRsmz1kdB .cluster text{fill:#333;}#mermaid-svg-0O0OWZzoRsmz1kdB .cluster span{color:#333;}#mermaid-svg-0O0OWZzoRsmz1kdB div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-0O0OWZzoRsmz1kdB .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-0O0OWZzoRsmz1kdB rect.text{fill:none;stroke-width:0;}#mermaid-svg-0O0OWZzoRsmz1kdB .icon-shape,#mermaid-svg-0O0OWZzoRsmz1kdB .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0O0OWZzoRsmz1kdB .icon-shape p,#mermaid-svg-0O0OWZzoRsmz1kdB .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-0O0OWZzoRsmz1kdB .icon-shape .label rect,#mermaid-svg-0O0OWZzoRsmz1kdB .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0O0OWZzoRsmz1kdB .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-0O0OWZzoRsmz1kdB .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-0O0OWZzoRsmz1kdB :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-0O0OWZzoRsmz1kdB .stage>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-0O0OWZzoRsmz1kdB .stage span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-0O0OWZzoRsmz1kdB .stage tspan{fill:#1e3a8a!important;} 开发
测试
运维
客户
让价值交付的"管道"越短越好、越快越好。
核心实践:
- 持续集成/持续部署(CI/CD)
- 基础设施即代码(Infrastructure as Code)
- 缩小批次规模(小步快跑,而非大象搬家)
- 减少半成品库存(未上线的代码 = 浪费)
4.2、第二道:反馈(Feedback)------建立从右到左的反馈
#mermaid-svg-OXakTyIJbhSjQ39x{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-OXakTyIJbhSjQ39x .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-OXakTyIJbhSjQ39x .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-OXakTyIJbhSjQ39x .error-icon{fill:#552222;}#mermaid-svg-OXakTyIJbhSjQ39x .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-OXakTyIJbhSjQ39x .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-OXakTyIJbhSjQ39x .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-OXakTyIJbhSjQ39x .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-OXakTyIJbhSjQ39x .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-OXakTyIJbhSjQ39x .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-OXakTyIJbhSjQ39x .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-OXakTyIJbhSjQ39x .marker{fill:#333333;stroke:#333333;}#mermaid-svg-OXakTyIJbhSjQ39x .marker.cross{stroke:#333333;}#mermaid-svg-OXakTyIJbhSjQ39x svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-OXakTyIJbhSjQ39x p{margin:0;}#mermaid-svg-OXakTyIJbhSjQ39x .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-OXakTyIJbhSjQ39x .cluster-label text{fill:#333;}#mermaid-svg-OXakTyIJbhSjQ39x .cluster-label span{color:#333;}#mermaid-svg-OXakTyIJbhSjQ39x .cluster-label span p{background-color:transparent;}#mermaid-svg-OXakTyIJbhSjQ39x .label text,#mermaid-svg-OXakTyIJbhSjQ39x span{fill:#333;color:#333;}#mermaid-svg-OXakTyIJbhSjQ39x .node rect,#mermaid-svg-OXakTyIJbhSjQ39x .node circle,#mermaid-svg-OXakTyIJbhSjQ39x .node ellipse,#mermaid-svg-OXakTyIJbhSjQ39x .node polygon,#mermaid-svg-OXakTyIJbhSjQ39x .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-OXakTyIJbhSjQ39x .rough-node .label text,#mermaid-svg-OXakTyIJbhSjQ39x .node .label text,#mermaid-svg-OXakTyIJbhSjQ39x .image-shape .label,#mermaid-svg-OXakTyIJbhSjQ39x .icon-shape .label{text-anchor:middle;}#mermaid-svg-OXakTyIJbhSjQ39x .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-OXakTyIJbhSjQ39x .rough-node .label,#mermaid-svg-OXakTyIJbhSjQ39x .node .label,#mermaid-svg-OXakTyIJbhSjQ39x .image-shape .label,#mermaid-svg-OXakTyIJbhSjQ39x .icon-shape .label{text-align:center;}#mermaid-svg-OXakTyIJbhSjQ39x .node.clickable{cursor:pointer;}#mermaid-svg-OXakTyIJbhSjQ39x .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-OXakTyIJbhSjQ39x .arrowheadPath{fill:#333333;}#mermaid-svg-OXakTyIJbhSjQ39x .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-OXakTyIJbhSjQ39x .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-OXakTyIJbhSjQ39x .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-OXakTyIJbhSjQ39x .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-OXakTyIJbhSjQ39x .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-OXakTyIJbhSjQ39x .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-OXakTyIJbhSjQ39x .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-OXakTyIJbhSjQ39x .cluster text{fill:#333;}#mermaid-svg-OXakTyIJbhSjQ39x .cluster span{color:#333;}#mermaid-svg-OXakTyIJbhSjQ39x div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-OXakTyIJbhSjQ39x .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-OXakTyIJbhSjQ39x rect.text{fill:none;stroke-width:0;}#mermaid-svg-OXakTyIJbhSjQ39x .icon-shape,#mermaid-svg-OXakTyIJbhSjQ39x .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-OXakTyIJbhSjQ39x .icon-shape p,#mermaid-svg-OXakTyIJbhSjQ39x .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-OXakTyIJbhSjQ39x .icon-shape .label rect,#mermaid-svg-OXakTyIJbhSjQ39x .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-OXakTyIJbhSjQ39x .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-OXakTyIJbhSjQ39x .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-OXakTyIJbhSjQ39x :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-OXakTyIJbhSjQ39x .stage>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-OXakTyIJbhSjQ39x .stage span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-OXakTyIJbhSjQ39x .stage tspan{fill:#1e3a8a!important;} 客户
运维
测试
开发
让生产环境的信息快速回流到开发环节。
核心实践:
- 生产环境监控告警(出问题开发团队先知道,不是客户先知道)
- 线上问题由开发团队主导排查
- A/B 测试和灰度发布(用真实流量验证)
4.3、第三道:持续学习与实验(Continual Learning)
text
不怕出问题,怕的是出了同样的问题第二次。
核心实践:
- 无指责的事后复盘(Blameless Postmortem)
- 混沌工程(主动注入故障验证系统韧性)
- 实验文化(鼓励尝试,失败是学习机会)
- 知识共享(把事情写下来,而不是烂在一个人脑子里)
5、CI/CD:DevOps 的核心技术落地

如果 DevOps 是"道",CI/CD 就是"术"。这三个缩写经常被混用,用一张表厘清最清楚:
| 缩写 | 全称 | 做到哪一步 | 最后一步谁来 |
|---|---|---|---|
| CI | Continuous Integration(持续集成) | 提交 → 自动构建 + 测试,尽早发现问题 | ---(不涉及发布) |
| CD | Continuous Delivery(持续交付) | 一直到"生成可发布的部署包",随时处于可发布状态 | 人工点击发布 |
| CD | Continuous Deployment(持续部署) | 一直到"自动上线生产" | 机器自动执行 |
两个 CD 缩写相同、极易混淆:Delivery 停在"随时能发",Deployment 做到"自动就发"。(能力上)Deployment 是 Delivery 的超集------先具备持续交付能力,再把最后一步自动化。
5.1、CI/CD 从哪来:同样是被"集成地狱"逼出来的
CI/CD 不是某天被发明的,而是软件规模膨胀后自然演化出来的。早年软件小、发布慢,问题不大;等到一个项目上百人、几百万行代码,一个严重现象出现了------大家各写各的,攒一周再合并:
#mermaid-svg-MXSnbAwBcStMsmGz{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-MXSnbAwBcStMsmGz .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-MXSnbAwBcStMsmGz .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-MXSnbAwBcStMsmGz .error-icon{fill:#552222;}#mermaid-svg-MXSnbAwBcStMsmGz .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-MXSnbAwBcStMsmGz .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-MXSnbAwBcStMsmGz .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-MXSnbAwBcStMsmGz .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-MXSnbAwBcStMsmGz .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-MXSnbAwBcStMsmGz .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-MXSnbAwBcStMsmGz .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-MXSnbAwBcStMsmGz .marker{fill:#333333;stroke:#333333;}#mermaid-svg-MXSnbAwBcStMsmGz .marker.cross{stroke:#333333;}#mermaid-svg-MXSnbAwBcStMsmGz svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-MXSnbAwBcStMsmGz p{margin:0;}#mermaid-svg-MXSnbAwBcStMsmGz .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-MXSnbAwBcStMsmGz .cluster-label text{fill:#333;}#mermaid-svg-MXSnbAwBcStMsmGz .cluster-label span{color:#333;}#mermaid-svg-MXSnbAwBcStMsmGz .cluster-label span p{background-color:transparent;}#mermaid-svg-MXSnbAwBcStMsmGz .label text,#mermaid-svg-MXSnbAwBcStMsmGz span{fill:#333;color:#333;}#mermaid-svg-MXSnbAwBcStMsmGz .node rect,#mermaid-svg-MXSnbAwBcStMsmGz .node circle,#mermaid-svg-MXSnbAwBcStMsmGz .node ellipse,#mermaid-svg-MXSnbAwBcStMsmGz .node polygon,#mermaid-svg-MXSnbAwBcStMsmGz .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-MXSnbAwBcStMsmGz .rough-node .label text,#mermaid-svg-MXSnbAwBcStMsmGz .node .label text,#mermaid-svg-MXSnbAwBcStMsmGz .image-shape .label,#mermaid-svg-MXSnbAwBcStMsmGz .icon-shape .label{text-anchor:middle;}#mermaid-svg-MXSnbAwBcStMsmGz .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-MXSnbAwBcStMsmGz .rough-node .label,#mermaid-svg-MXSnbAwBcStMsmGz .node .label,#mermaid-svg-MXSnbAwBcStMsmGz .image-shape .label,#mermaid-svg-MXSnbAwBcStMsmGz .icon-shape .label{text-align:center;}#mermaid-svg-MXSnbAwBcStMsmGz .node.clickable{cursor:pointer;}#mermaid-svg-MXSnbAwBcStMsmGz .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-MXSnbAwBcStMsmGz .arrowheadPath{fill:#333333;}#mermaid-svg-MXSnbAwBcStMsmGz .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-MXSnbAwBcStMsmGz .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-MXSnbAwBcStMsmGz .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-MXSnbAwBcStMsmGz .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-MXSnbAwBcStMsmGz .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-MXSnbAwBcStMsmGz .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-MXSnbAwBcStMsmGz .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-MXSnbAwBcStMsmGz .cluster text{fill:#333;}#mermaid-svg-MXSnbAwBcStMsmGz .cluster span{color:#333;}#mermaid-svg-MXSnbAwBcStMsmGz div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-MXSnbAwBcStMsmGz .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-MXSnbAwBcStMsmGz rect.text{fill:none;stroke-width:0;}#mermaid-svg-MXSnbAwBcStMsmGz .icon-shape,#mermaid-svg-MXSnbAwBcStMsmGz .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-MXSnbAwBcStMsmGz .icon-shape p,#mermaid-svg-MXSnbAwBcStMsmGz .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-MXSnbAwBcStMsmGz .icon-shape .label rect,#mermaid-svg-MXSnbAwBcStMsmGz .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-MXSnbAwBcStMsmGz .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-MXSnbAwBcStMsmGz .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-MXSnbAwBcStMsmGz :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-MXSnbAwBcStMsmGz .stage>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-MXSnbAwBcStMsmGz .stage span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-MXSnbAwBcStMsmGz .stage tspan{fill:#1e3a8a!important;}#mermaid-svg-MXSnbAwBcStMsmGz .pain>*{fill:#fee2e2!important;stroke:#dc2626!important;stroke-width:1px!important;color:#7f1d1d!important;}#mermaid-svg-MXSnbAwBcStMsmGz .pain span{fill:#fee2e2!important;stroke:#dc2626!important;stroke-width:1px!important;color:#7f1d1d!important;}#mermaid-svg-MXSnbAwBcStMsmGz .pain tspan{fill:#7f1d1d!important;}#mermaid-svg-MXSnbAwBcStMsmGz .test>*{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-MXSnbAwBcStMsmGz .test span{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-MXSnbAwBcStMsmGz .test tspan{fill:#14532b!important;} 小明改了登录
一星期后全部合并到一起
小红改了支付
小刚改了数据库
编译不过
集中找 Bug(三天)
终于能跑
这就是经典的 Integration Hell(集成地狱)------"不是写代码难,而是大家的代码合到一起太难"。CI/CD 的整条演化线,都是在跟它及其衍生问题(发布慢、发布险)作斗争:
- CI 的关键人物 :术语一般追溯到 Grady Booch (1991 年前后《Object-Oriented Design with Applications》,其含义偏 OO 设计的增量式集成,与今天的自动化实践不完全等同);真正把它变成团队日常纪律的是 Kent Beck ,他在 1999 年《Extreme Programming Explained》 中把持续集成列为 XP 核心实践。早期 XP 的强度是"每天至少集成一次",而非今天"每次提交都自动触发"------后者是随工具成熟才做到的。CI 的核心目标一句话:尽早发现错误,而不是最后一起发现。
- CD 的关键人物 :Jez Humble 与 David Farley 在 2010 年 出版《Continuous Delivery》(获 2011 年 Jolt 奖),奠定了持续交付的理论基础,主张"随时具备安全发布的能力"(不是必须一直发,而是随时能发)。再进一步的 Continuous Deployment(持续部署) ------测试通过即自动上线------的标志性实践是 Timothy Fitz 2009 年《Continuous Deployment at IMVU》,随后 Etsy、Netflix 等以大规模持续部署广为人知。
5.2、一条演进时间线
把 CI/CD 放进整个方法论演进里看,更清楚它补的是哪一环:
#mermaid-svg-pyAKB9JAQzVvR6Kw{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-pyAKB9JAQzVvR6Kw .error-icon{fill:#552222;}#mermaid-svg-pyAKB9JAQzVvR6Kw .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-pyAKB9JAQzVvR6Kw .marker{fill:#333333;stroke:#333333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .marker.cross{stroke:#333333;}#mermaid-svg-pyAKB9JAQzVvR6Kw svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-pyAKB9JAQzVvR6Kw p{margin:0;}#mermaid-svg-pyAKB9JAQzVvR6Kw .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .cluster-label text{fill:#333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .cluster-label span{color:#333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .cluster-label span p{background-color:transparent;}#mermaid-svg-pyAKB9JAQzVvR6Kw .label text,#mermaid-svg-pyAKB9JAQzVvR6Kw span{fill:#333;color:#333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .node rect,#mermaid-svg-pyAKB9JAQzVvR6Kw .node circle,#mermaid-svg-pyAKB9JAQzVvR6Kw .node ellipse,#mermaid-svg-pyAKB9JAQzVvR6Kw .node polygon,#mermaid-svg-pyAKB9JAQzVvR6Kw .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-pyAKB9JAQzVvR6Kw .rough-node .label text,#mermaid-svg-pyAKB9JAQzVvR6Kw .node .label text,#mermaid-svg-pyAKB9JAQzVvR6Kw .image-shape .label,#mermaid-svg-pyAKB9JAQzVvR6Kw .icon-shape .label{text-anchor:middle;}#mermaid-svg-pyAKB9JAQzVvR6Kw .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-pyAKB9JAQzVvR6Kw .rough-node .label,#mermaid-svg-pyAKB9JAQzVvR6Kw .node .label,#mermaid-svg-pyAKB9JAQzVvR6Kw .image-shape .label,#mermaid-svg-pyAKB9JAQzVvR6Kw .icon-shape .label{text-align:center;}#mermaid-svg-pyAKB9JAQzVvR6Kw .node.clickable{cursor:pointer;}#mermaid-svg-pyAKB9JAQzVvR6Kw .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .arrowheadPath{fill:#333333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-pyAKB9JAQzVvR6Kw .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pyAKB9JAQzVvR6Kw .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-pyAKB9JAQzVvR6Kw .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pyAKB9JAQzVvR6Kw .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-pyAKB9JAQzVvR6Kw .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-pyAKB9JAQzVvR6Kw .cluster text{fill:#333;}#mermaid-svg-pyAKB9JAQzVvR6Kw .cluster span{color:#333;}#mermaid-svg-pyAKB9JAQzVvR6Kw div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-pyAKB9JAQzVvR6Kw .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-pyAKB9JAQzVvR6Kw rect.text{fill:none;stroke-width:0;}#mermaid-svg-pyAKB9JAQzVvR6Kw .icon-shape,#mermaid-svg-pyAKB9JAQzVvR6Kw .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pyAKB9JAQzVvR6Kw .icon-shape p,#mermaid-svg-pyAKB9JAQzVvR6Kw .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-pyAKB9JAQzVvR6Kw .icon-shape .label rect,#mermaid-svg-pyAKB9JAQzVvR6Kw .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pyAKB9JAQzVvR6Kw .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-pyAKB9JAQzVvR6Kw .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-pyAKB9JAQzVvR6Kw :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-pyAKB9JAQzVvR6Kw .stage>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-pyAKB9JAQzVvR6Kw .stage span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-pyAKB9JAQzVvR6Kw .stage tspan{fill:#1e3a8a!important;}#mermaid-svg-pyAKB9JAQzVvR6Kw .ai>*{fill:#fef3c7!important;stroke:#d97706!important;stroke-width:1px!important;color:#78350f!important;}#mermaid-svg-pyAKB9JAQzVvR6Kw .ai span{fill:#fef3c7!important;stroke:#d97706!important;stroke-width:1px!important;color:#78350f!important;}#mermaid-svg-pyAKB9JAQzVvR6Kw .ai tspan{fill:#78350f!important;} 1970 年代
瀑布 Waterfall:大版本、长周期
1990 年代
敏捷 Agile:小步快跑(2001《敏捷宣言》)
1999 年
持续集成 CI:立即合并、编译、测试
2009 年
持续部署实践 + DevOps 文化(同期)
2010 年
持续交付 CD:随时可安全发布
今天
DevOps:开发 / 测试 / 运维紧密协作
未来
AI Coding / AI Agent:AI 参与全流程
年份是"标志性事件"的近似锚点,并非严格接力。Continuous Deployment 的实践(2009)甚至早于《Continuous Delivery》成书(2010)------这是"实践出现"与"理论成书"的时间差,概念上仍是先有交付能力、再谈自动部署。
一条典型的 CI/CD 流水线:
#mermaid-svg-OWY99Sp7EldDdoGN{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-OWY99Sp7EldDdoGN .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-OWY99Sp7EldDdoGN .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-OWY99Sp7EldDdoGN .error-icon{fill:#552222;}#mermaid-svg-OWY99Sp7EldDdoGN .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-OWY99Sp7EldDdoGN .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-OWY99Sp7EldDdoGN .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-OWY99Sp7EldDdoGN .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-OWY99Sp7EldDdoGN .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-OWY99Sp7EldDdoGN .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-OWY99Sp7EldDdoGN .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-OWY99Sp7EldDdoGN .marker{fill:#333333;stroke:#333333;}#mermaid-svg-OWY99Sp7EldDdoGN .marker.cross{stroke:#333333;}#mermaid-svg-OWY99Sp7EldDdoGN svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-OWY99Sp7EldDdoGN p{margin:0;}#mermaid-svg-OWY99Sp7EldDdoGN .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-OWY99Sp7EldDdoGN .cluster-label text{fill:#333;}#mermaid-svg-OWY99Sp7EldDdoGN .cluster-label span{color:#333;}#mermaid-svg-OWY99Sp7EldDdoGN .cluster-label span p{background-color:transparent;}#mermaid-svg-OWY99Sp7EldDdoGN .label text,#mermaid-svg-OWY99Sp7EldDdoGN span{fill:#333;color:#333;}#mermaid-svg-OWY99Sp7EldDdoGN .node rect,#mermaid-svg-OWY99Sp7EldDdoGN .node circle,#mermaid-svg-OWY99Sp7EldDdoGN .node ellipse,#mermaid-svg-OWY99Sp7EldDdoGN .node polygon,#mermaid-svg-OWY99Sp7EldDdoGN .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-OWY99Sp7EldDdoGN .rough-node .label text,#mermaid-svg-OWY99Sp7EldDdoGN .node .label text,#mermaid-svg-OWY99Sp7EldDdoGN .image-shape .label,#mermaid-svg-OWY99Sp7EldDdoGN .icon-shape .label{text-anchor:middle;}#mermaid-svg-OWY99Sp7EldDdoGN .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-OWY99Sp7EldDdoGN .rough-node .label,#mermaid-svg-OWY99Sp7EldDdoGN .node .label,#mermaid-svg-OWY99Sp7EldDdoGN .image-shape .label,#mermaid-svg-OWY99Sp7EldDdoGN .icon-shape .label{text-align:center;}#mermaid-svg-OWY99Sp7EldDdoGN .node.clickable{cursor:pointer;}#mermaid-svg-OWY99Sp7EldDdoGN .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-OWY99Sp7EldDdoGN .arrowheadPath{fill:#333333;}#mermaid-svg-OWY99Sp7EldDdoGN .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-OWY99Sp7EldDdoGN .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-OWY99Sp7EldDdoGN .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-OWY99Sp7EldDdoGN .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-OWY99Sp7EldDdoGN .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-OWY99Sp7EldDdoGN .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-OWY99Sp7EldDdoGN .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-OWY99Sp7EldDdoGN .cluster text{fill:#333;}#mermaid-svg-OWY99Sp7EldDdoGN .cluster span{color:#333;}#mermaid-svg-OWY99Sp7EldDdoGN div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-OWY99Sp7EldDdoGN .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-OWY99Sp7EldDdoGN rect.text{fill:none;stroke-width:0;}#mermaid-svg-OWY99Sp7EldDdoGN .icon-shape,#mermaid-svg-OWY99Sp7EldDdoGN .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-OWY99Sp7EldDdoGN .icon-shape p,#mermaid-svg-OWY99Sp7EldDdoGN .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-OWY99Sp7EldDdoGN .icon-shape .label rect,#mermaid-svg-OWY99Sp7EldDdoGN .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-OWY99Sp7EldDdoGN .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-OWY99Sp7EldDdoGN .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-OWY99Sp7EldDdoGN :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-OWY99Sp7EldDdoGN .ci>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-OWY99Sp7EldDdoGN .ci span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-OWY99Sp7EldDdoGN .ci tspan{fill:#1e3a8a!important;}#mermaid-svg-OWY99Sp7EldDdoGN .cd>*{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-OWY99Sp7EldDdoGN .cd span{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-OWY99Sp7EldDdoGN .cd tspan{fill:#14532b!important;} 反馈给开发
Git Push
编译构建
单元测试
代码检查
lint / SAST
构建镜像
部署测试环境
集成测试
灰度发布
生产环境上线
持续监控 + 告警
蓝色为 CI 部分 (质量把关),绿色为 CD 部分(自动部署)。
5.3、用扫地机器人理解 CI/CD
抽象概念容易忘,换成一个扫地机器人制造厂就好懂了。团队里小明写避障、小红写建图、你写沿墙清扫......各写各的,一周后合并------地图没了、回不了充电座、沿墙也失灵,接下来三四天全在找 Bug。这就是集成地狱的具象版。
CI 在扫地机里 :你改完沿墙算法 git push 后,机器自动开跑,任一环失败就禁止合并------像一个永远不偷懒的老师:
#mermaid-svg-l4817cXpJKmoYcRt{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-l4817cXpJKmoYcRt .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-l4817cXpJKmoYcRt .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-l4817cXpJKmoYcRt .error-icon{fill:#552222;}#mermaid-svg-l4817cXpJKmoYcRt .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-l4817cXpJKmoYcRt .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-l4817cXpJKmoYcRt .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-l4817cXpJKmoYcRt .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-l4817cXpJKmoYcRt .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-l4817cXpJKmoYcRt .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-l4817cXpJKmoYcRt .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-l4817cXpJKmoYcRt .marker{fill:#333333;stroke:#333333;}#mermaid-svg-l4817cXpJKmoYcRt .marker.cross{stroke:#333333;}#mermaid-svg-l4817cXpJKmoYcRt svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-l4817cXpJKmoYcRt p{margin:0;}#mermaid-svg-l4817cXpJKmoYcRt .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-l4817cXpJKmoYcRt .cluster-label text{fill:#333;}#mermaid-svg-l4817cXpJKmoYcRt .cluster-label span{color:#333;}#mermaid-svg-l4817cXpJKmoYcRt .cluster-label span p{background-color:transparent;}#mermaid-svg-l4817cXpJKmoYcRt .label text,#mermaid-svg-l4817cXpJKmoYcRt span{fill:#333;color:#333;}#mermaid-svg-l4817cXpJKmoYcRt .node rect,#mermaid-svg-l4817cXpJKmoYcRt .node circle,#mermaid-svg-l4817cXpJKmoYcRt .node ellipse,#mermaid-svg-l4817cXpJKmoYcRt .node polygon,#mermaid-svg-l4817cXpJKmoYcRt .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-l4817cXpJKmoYcRt .rough-node .label text,#mermaid-svg-l4817cXpJKmoYcRt .node .label text,#mermaid-svg-l4817cXpJKmoYcRt .image-shape .label,#mermaid-svg-l4817cXpJKmoYcRt .icon-shape .label{text-anchor:middle;}#mermaid-svg-l4817cXpJKmoYcRt .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-l4817cXpJKmoYcRt .rough-node .label,#mermaid-svg-l4817cXpJKmoYcRt .node .label,#mermaid-svg-l4817cXpJKmoYcRt .image-shape .label,#mermaid-svg-l4817cXpJKmoYcRt .icon-shape .label{text-align:center;}#mermaid-svg-l4817cXpJKmoYcRt .node.clickable{cursor:pointer;}#mermaid-svg-l4817cXpJKmoYcRt .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-l4817cXpJKmoYcRt .arrowheadPath{fill:#333333;}#mermaid-svg-l4817cXpJKmoYcRt .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-l4817cXpJKmoYcRt .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-l4817cXpJKmoYcRt .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-l4817cXpJKmoYcRt .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-l4817cXpJKmoYcRt .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-l4817cXpJKmoYcRt .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-l4817cXpJKmoYcRt .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-l4817cXpJKmoYcRt .cluster text{fill:#333;}#mermaid-svg-l4817cXpJKmoYcRt .cluster span{color:#333;}#mermaid-svg-l4817cXpJKmoYcRt div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-l4817cXpJKmoYcRt .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-l4817cXpJKmoYcRt rect.text{fill:none;stroke-width:0;}#mermaid-svg-l4817cXpJKmoYcRt .icon-shape,#mermaid-svg-l4817cXpJKmoYcRt .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-l4817cXpJKmoYcRt .icon-shape p,#mermaid-svg-l4817cXpJKmoYcRt .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-l4817cXpJKmoYcRt .icon-shape .label rect,#mermaid-svg-l4817cXpJKmoYcRt .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-l4817cXpJKmoYcRt .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-l4817cXpJKmoYcRt .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-l4817cXpJKmoYcRt :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-l4817cXpJKmoYcRt .stage>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-l4817cXpJKmoYcRt .stage span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-l4817cXpJKmoYcRt .stage tspan{fill:#1e3a8a!important;}#mermaid-svg-l4817cXpJKmoYcRt .test>*{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-l4817cXpJKmoYcRt .test span{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-l4817cXpJKmoYcRt .test tspan{fill:#14532b!important;} 自动编译(编不出来立刻报警)
自动单元测试(建图/回充/避障/沿墙)
自动代码检查(规范/内存泄漏/危险代码/格式)
git push
编译通过
测试通过
检查通过 → 允许合并
CD 在扫地机里:CI 全绿后,把"检查通过的程序"自动送上机器人:
#mermaid-svg-9PuAk1fDmiaRCAx0{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-9PuAk1fDmiaRCAx0 .error-icon{fill:#552222;}#mermaid-svg-9PuAk1fDmiaRCAx0 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-9PuAk1fDmiaRCAx0 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .marker.cross{stroke:#333333;}#mermaid-svg-9PuAk1fDmiaRCAx0 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-9PuAk1fDmiaRCAx0 p{margin:0;}#mermaid-svg-9PuAk1fDmiaRCAx0 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cluster-label text{fill:#333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cluster-label span{color:#333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cluster-label span p{background-color:transparent;}#mermaid-svg-9PuAk1fDmiaRCAx0 .label text,#mermaid-svg-9PuAk1fDmiaRCAx0 span{fill:#333;color:#333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .node rect,#mermaid-svg-9PuAk1fDmiaRCAx0 .node circle,#mermaid-svg-9PuAk1fDmiaRCAx0 .node ellipse,#mermaid-svg-9PuAk1fDmiaRCAx0 .node polygon,#mermaid-svg-9PuAk1fDmiaRCAx0 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-9PuAk1fDmiaRCAx0 .rough-node .label text,#mermaid-svg-9PuAk1fDmiaRCAx0 .node .label text,#mermaid-svg-9PuAk1fDmiaRCAx0 .image-shape .label,#mermaid-svg-9PuAk1fDmiaRCAx0 .icon-shape .label{text-anchor:middle;}#mermaid-svg-9PuAk1fDmiaRCAx0 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-9PuAk1fDmiaRCAx0 .rough-node .label,#mermaid-svg-9PuAk1fDmiaRCAx0 .node .label,#mermaid-svg-9PuAk1fDmiaRCAx0 .image-shape .label,#mermaid-svg-9PuAk1fDmiaRCAx0 .icon-shape .label{text-align:center;}#mermaid-svg-9PuAk1fDmiaRCAx0 .node.clickable{cursor:pointer;}#mermaid-svg-9PuAk1fDmiaRCAx0 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .arrowheadPath{fill:#333333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-9PuAk1fDmiaRCAx0 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-9PuAk1fDmiaRCAx0 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-9PuAk1fDmiaRCAx0 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-9PuAk1fDmiaRCAx0 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-9PuAk1fDmiaRCAx0 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cluster text{fill:#333;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cluster span{color:#333;}#mermaid-svg-9PuAk1fDmiaRCAx0 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-9PuAk1fDmiaRCAx0 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-9PuAk1fDmiaRCAx0 rect.text{fill:none;stroke-width:0;}#mermaid-svg-9PuAk1fDmiaRCAx0 .icon-shape,#mermaid-svg-9PuAk1fDmiaRCAx0 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-9PuAk1fDmiaRCAx0 .icon-shape p,#mermaid-svg-9PuAk1fDmiaRCAx0 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-9PuAk1fDmiaRCAx0 .icon-shape .label rect,#mermaid-svg-9PuAk1fDmiaRCAx0 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-9PuAk1fDmiaRCAx0 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-9PuAk1fDmiaRCAx0 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-9PuAk1fDmiaRCAx0 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cd>*{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cd span{fill:#dcfce7!important;stroke:#16a34a!important;stroke-width:1px!important;color:#14532b!important;}#mermaid-svg-9PuAk1fDmiaRCAx0 .cd tspan{fill:#14532b!important;} CI 全部通过
自动生成固件 robot_v2.3.bin
自动烧录到测试机器人 001 / 002 / 003
机器人自动跑测试场
绕椅子 / 钻桌子 / 回充 / 断点续扫 / 跨门槛
自动录像 + 上传结果
微信群通知:今天版本通过
最后一步若需人点一下确认,就是 Continuous Delivery ;若全自动推到用户,就是 Continuous Deployment。同一件"改完避障 → 上机验证"的事,过去要两三天,CI/CD 后约 20 分钟------这也是为什么日活千万的互联网产品宁可"一天发布几十上百次、每次只改一点点":Bug 更好定位、单次风险更小。
5.4、常见工具速览
| 环节 | 常见工具 |
|---|---|
| CI / 流水线 | Jenkins、GitLab CI/CD、GitHub Actions |
| 容器 | Docker |
| 编排 | Kubernetes |
| 监控可观测 | Prometheus、Grafana |
工具只是"术"。CI/CD 的"道"是频繁集成 + 随时可发布------没有小批次、快反馈的习惯,堆再多工具也不等于做到了 CI/CD。这一点和本篇开头"DevOps 是文化不是工具"完全同源。
6、为什么 DevOps 不是"招一个 DevOps 工程师"就能解决的
这是一个非常常见的组织误解:
text
❌ 错误理解:
"我们需要 DevOps,招一个 DevOps 工程师吧。"
→ 然后这个工程师成了新的"墙"------开发扔给 DevOps 工程师,
DevOps 工程师扔给运维
✓ 正确理解:
DevOps 是一种组织文化和协作方式,不是一个岗位。
目标是让 Dev 和 Ops 之间的那堵"墙"消失。
如果一个团队声称在做 DevOps,但开发和运维依然互不沟通、互不信任、互相甩锅------无论用了多少 Docker、Kubernetes、Jenkins、Terraform,它们都不是 DevOps。
7、DevOps 与 AI 时代
AI 编程工具正在让"个人开发效率"大幅提升,但这反而让 DevOps 变得更加重要:
text
过去:开发慢,部署也慢 → DevOps 优化部署效率很有价值
现在:开发极快(AI 辅助),部署跟不上 → DevOps 成了瓶颈
如果你的 AI 可以在 10 分钟内生成一个功能,
但代码还需要 3 天才能通过手工流程上线,
那 AI 省下的时间全浪费在等待里了。
因此 AI 时代的 DevOps 趋势是:
#mermaid-svg-0cbQOhY3y7UEfbPs{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-0cbQOhY3y7UEfbPs .error-icon{fill:#552222;}#mermaid-svg-0cbQOhY3y7UEfbPs .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-0cbQOhY3y7UEfbPs .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-0cbQOhY3y7UEfbPs .marker{fill:#333333;stroke:#333333;}#mermaid-svg-0cbQOhY3y7UEfbPs .marker.cross{stroke:#333333;}#mermaid-svg-0cbQOhY3y7UEfbPs svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-0cbQOhY3y7UEfbPs p{margin:0;}#mermaid-svg-0cbQOhY3y7UEfbPs .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-0cbQOhY3y7UEfbPs .cluster-label text{fill:#333;}#mermaid-svg-0cbQOhY3y7UEfbPs .cluster-label span{color:#333;}#mermaid-svg-0cbQOhY3y7UEfbPs .cluster-label span p{background-color:transparent;}#mermaid-svg-0cbQOhY3y7UEfbPs .label text,#mermaid-svg-0cbQOhY3y7UEfbPs span{fill:#333;color:#333;}#mermaid-svg-0cbQOhY3y7UEfbPs .node rect,#mermaid-svg-0cbQOhY3y7UEfbPs .node circle,#mermaid-svg-0cbQOhY3y7UEfbPs .node ellipse,#mermaid-svg-0cbQOhY3y7UEfbPs .node polygon,#mermaid-svg-0cbQOhY3y7UEfbPs .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-0cbQOhY3y7UEfbPs .rough-node .label text,#mermaid-svg-0cbQOhY3y7UEfbPs .node .label text,#mermaid-svg-0cbQOhY3y7UEfbPs .image-shape .label,#mermaid-svg-0cbQOhY3y7UEfbPs .icon-shape .label{text-anchor:middle;}#mermaid-svg-0cbQOhY3y7UEfbPs .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-0cbQOhY3y7UEfbPs .rough-node .label,#mermaid-svg-0cbQOhY3y7UEfbPs .node .label,#mermaid-svg-0cbQOhY3y7UEfbPs .image-shape .label,#mermaid-svg-0cbQOhY3y7UEfbPs .icon-shape .label{text-align:center;}#mermaid-svg-0cbQOhY3y7UEfbPs .node.clickable{cursor:pointer;}#mermaid-svg-0cbQOhY3y7UEfbPs .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-0cbQOhY3y7UEfbPs .arrowheadPath{fill:#333333;}#mermaid-svg-0cbQOhY3y7UEfbPs .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-0cbQOhY3y7UEfbPs .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-0cbQOhY3y7UEfbPs .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0cbQOhY3y7UEfbPs .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-0cbQOhY3y7UEfbPs .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0cbQOhY3y7UEfbPs .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-0cbQOhY3y7UEfbPs .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-0cbQOhY3y7UEfbPs .cluster text{fill:#333;}#mermaid-svg-0cbQOhY3y7UEfbPs .cluster span{color:#333;}#mermaid-svg-0cbQOhY3y7UEfbPs div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-0cbQOhY3y7UEfbPs .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-0cbQOhY3y7UEfbPs rect.text{fill:none;stroke-width:0;}#mermaid-svg-0cbQOhY3y7UEfbPs .icon-shape,#mermaid-svg-0cbQOhY3y7UEfbPs .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0cbQOhY3y7UEfbPs .icon-shape p,#mermaid-svg-0cbQOhY3y7UEfbPs .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-0cbQOhY3y7UEfbPs .icon-shape .label rect,#mermaid-svg-0cbQOhY3y7UEfbPs .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0cbQOhY3y7UEfbPs .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-0cbQOhY3y7UEfbPs .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-0cbQOhY3y7UEfbPs :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-0cbQOhY3y7UEfbPs .ai>*{fill:#fef3c7!important;stroke:#d97706!important;stroke-width:1px!important;color:#78350f!important;}#mermaid-svg-0cbQOhY3y7UEfbPs .ai span{fill:#fef3c7!important;stroke:#d97706!important;stroke-width:1px!important;color:#78350f!important;}#mermaid-svg-0cbQOhY3y7UEfbPs .ai tspan{fill:#78350f!important;}#mermaid-svg-0cbQOhY3y7UEfbPs .stage>*{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-0cbQOhY3y7UEfbPs .stage span{fill:#dbeafe!important;stroke:#2563eb!important;stroke-width:1px!important;color:#1e3a8a!important;}#mermaid-svg-0cbQOhY3y7UEfbPs .stage tspan{fill:#1e3a8a!important;} 反馈给下一轮开发
AI 生成代码
AI 生成测试
CI 自动检查
测试 / lint / 安全扫描
AI 自动修复 CI 失败
CD 自动部署
AI 分析生产监控数据
这就是所谓的 AI-Native DevOps 闭环------人负责 Review 和决策,机器负责执行和反馈。
8、本篇要点速记

text
DevOps = 文化运动 + 工具链 + 自动化实践
诞生于 2009 年,Patrick Debois 组织首届 DevOpsDays 并创造 #DevOps 话题标签。
核心主张:You build it, you run it.
三条道路:Flow(加快交付)→ Feedback(快速反馈)→ Learning(持续学习)
CI/CD:
CI = 每提交必构建测试
CD = Delivery(人工发布)或 Deployment(自动发布)
关键:DevOps 是文化,不是一个岗位名称。
一句话:让写代码的人和跑代码的人是同一拨人,把所有能自动化的都自动化。
9、You build it, you run it 的疑惑
很多人第一次看到 You build it, you run it. 都会理解成:"以后不要测试了,也不要运维了,开发自己全干。"
其实,这是错误的理解。真正的意思其实是:你不仅要对"写代码"负责,还要对"代码上线后的结果"负责。
DevOps 真正想表达什么?写代码的人,应该关心代码上线以后发生了什么。
那测试是不是没用了?既然 CI 自动测试了,还要测试工程师干嘛?
当然要,只是工作内容变了
以前:
text
点按钮
点100遍
点200遍
人工测试
之后更多是在设计测试体系。
text
设计:
10000 个自动测试
↓
自动生成测试数据
↓
自动回归
↓
自动性能测试
↓
自动压力测试
↓
自动安全扫描
以前人在测试,现在人设计测试,机器负责执行测试
运维是不是没用了?
也不是,以前运维天天
text
登录服务器
复制文件
重启程序
修改配置
人工发布
DevOps 之后,开始建设整个运行平台。

text
Kubernetes
Docker
云平台
监控
日志
告警
自动扩容
自动恢复
权限管理
网络
数据库
GPU 集群
真正变化的是"职责",不是"岗位"

所以,You build it, you run it 的真正含义不是 "开发把测试和运维的工作都抢了。而是
-
开发要对自己交付的软件负责到底
-
测试和运维则从大量重复的手工劳动,升级为自动化平台和工程体系的建设者。

上一篇:看板方法
下一篇:AI Native 开发 ------ 当 AI 从工具变成协作伙伴