1.8 KiB
1.8 KiB
id, title, type, domain, stack, tags, week
| id | title | type | domain | stack | tags | week | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| devops.cicd.index | CI/CD | index | devops |
|
|
|
CI/CD
持续集成(每次提交自动检查、测试、构建)和持续部署(自动发布到环境)。面试里常被问“你们的发布流程是怎样的”“出问题怎么回滚”。本专题以 GitHub Actions 语法为例(Gitea Actions 基本兼容,GitLab CI 思路相同),重点是流水线设计、发布策略和回滚,而不是某个平台的细节。
学习路线
| 顺序 | 课程 | 级别 | 预计 |
|---|---|---|---|
| 1 | 流水线设计:触发、阶段、缓存、服务容器、密钥 | 基础 | 2 小时 |
| 2 | 发布与回滚:镜像标签、环境、滚动 / 蓝绿 / 金丝雀、数据库迁移 | 进阶 | 3 小时 |
企业场景
面试题
示例代码
- examples/pipeline:
ci.yml(GitHub Actions 语法的完整流水线)、deploy.sh(单机部署 + 健康检查 + 自动回滚,已用 shellcheck 检查)、test_ci_config.py(对流水线配置做结构检查)。流水线本身需要在 CI 平台上实际运行验证
在 16 周计划中
官方资料
- GitHub Actions:https://docs.github.com/actions
- Gitea Actions:https://docs.gitea.com/usage/actions/overview
- GitLab CI/CD:https://docs.gitlab.com/ci/