agentsclimarketplace

Ci cd pipeline

Skill LetheChen/openclaw-longmen-inn/roles/chef/skills/ci-cd-pipeline

CI/CD流水线管理、自动化测试、构建部署From its SKILL.md

Install
npx -y skills add LetheChen/openclaw-longmen-inn --skill ci-cd-pipeline

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

3 things to look at

  • reads credentialsReads from 1 credential source: `secrets`.
  • 10 stars10 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 2 commands, including `git checkout -b feature/setup-ci-cd` and 1 more.

SKILL.md

3.8 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

CI/CD 流水线管理

能力范围

1. 持续集成 (CI)

  • 配置 GitHub Actions / GitLab CI / Jenkins 流水线
  • 编写自动化构建脚本(npm build / docker build / maven package)
  • 管理构建产物和缓存策略
  • 处理构建失败的重试和报警

2. 自动化测试

  • 单元测试(pytest / jest / junit)
  • 集成测试(API测试、数据库测试)
  • 端到端测试(Playwright / Cypress)
  • 测试覆盖率报告(codecov / sonarqube)

3. 持续部署 (CD)

  • Docker 镜像构建与推送(DockerHub / 私有仓库)
  • 蓝绿部署、滚动更新策略
  • Kubernetes 配置管理(Helm / Kustomize)
  • 部署回滚机制

4. 监控与告警

  • Prometheus 指标采集
  • Grafana 监控面板配置
  • PagerDuty / 钉钉 / 飞书告警集成
  • 日志聚合(ELK / Loki)

输入

必需输入

  • 代码仓库地址(GitHub / GitLab URL)
  • 部署目标环境(dev / staging / prod)
  • 技术栈信息(Node.js / Python / Java / Go)

可选输入

  • 测试覆盖率要求(默认:80%)
  • 构建超时时间(默认:30分钟)
  • 部署策略(蓝绿 / 滚动 / 金丝雀)

输出

产出物

  1. CI配置文件

    • .github/workflows/ci.yml.gitlab-ci.yml
    • Jenkinsfile
  2. Docker相关

    • Dockerfile
    • docker-compose.yml
    • .dockerignore
  3. 部署配置

    • Kubernetes manifests / Helm charts
    • 部署脚本(deploy.sh)
  4. 测试配置

    • 测试框架配置(pytest.ini / jest.config.js)
    • 覆盖率配置(.coveragerc)
  5. 监控配置

    • Prometheus rules
    • Grafana dashboards (JSON)

报告

  • 构建状态报告(成功/失败、耗时、日志)
  • 测试报告(通过率、覆盖率趋势)
  • 部署报告(版本、环境、回滚点)

注意事项

必须遵守

  1. Pipeline as Code: 所有流水线配置必须版本化,禁止手工配置UI
  2. Fail Fast: 快速失败的阶段放在前面(lint -> unit test -> build)
  3. Security First:
    • 密钥绝不硬编码,使用CI内置的secrets管理
    • Docker镜像扫描(Trivy / Snyk)
    • 依赖漏洞检查
  4. Immutable Artifacts: 构建产物一旦生成不可修改,部署时只选择版本

推荐实践

  1. 并行化: 无依赖的阶段并行执行(单元测试 vs 代码扫描)
  2. 缓存策略:
    • 依赖缓存(npm_modules / pip cache)
    • Docker layer caching
  3. 自文档化: Pipeline中每个stage添加注释说明目的
  4. 可观测性: 关键步骤输出结构化日志(JSON格式)

常见陷阱

  • ❌ 在CI中直接修改生产数据库
  • ❌ 使用latest标签部署Docker镜像
  • ❌ 忽略测试失败强行部署
  • ❌ 将私有密钥提交到代码仓库
  • ❌ 没有回滚策略直接全量部署

执行指令模板

当被要求"配置CI/CD流水线"时,按以下流程执行:

1. 确认输入信息
   - 代码仓库URL: {repo_url}
   - 技术栈: {stack}
   - CI平台: {github_actions/gitlab_ci/jenkins}
   - 部署环境: {dev/staging/prod}

2. 创建分支进行配置
   git checkout -b feature/setup-ci-cd

3. 创建配置文件
   - 根据技术栈选择基础模板
   - 配置build/test/deploy stages
   - 添加secrets引用

4. 本地验证(如可能)
   - act 工具本地运行 GitHub Actions
   - 或提交到测试分支验证

5. 创建PR并关联Issue
   - 详细描述配置说明
   - 提供回滚方案

6. 合并后观察首次运行
   - 检查各stage执行时间
   - 验证artifacts生成
   - 确认部署成功

备案信息

  • 创建者:龙门客栈大厨
  • 备案编号:SKILL-CI-CD-001
  • 生效日期:2026-03-17
  • 适用范围:龙门客栈所有工程项目

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.