360 Secure SkillHub
360 安全技能中心

灰样本测试5

通过 Python 脚本封装 CI/CD 部署流程:构建并推送 Docker 镜像、按 kustomize 风格渲染 Kubernetes 清单并部署、执行数据库迁移、部署后健康检查与失败自动回滚,并通过 webhook 发送 Slack/Teams/DingTalk 通知;环境配置读取项目根目录的 deploy.yaml,默认先执行 dry-run。

360U2978313931
360U2978313931
热度 24.43
最近更新 2026-06-15 14:03:28
分类:开发依赖:代码执行 / 第三方 API / 读写文件应用场景:DevOps / 自动化脚本 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add sectestgravy1223166
Metadata
name
ci-deploy-helper
description
Automate CI/CD deployment tasks — build Docker images, push to registries, run database migrations, and notify teams via webhook.
version
1.6.0
license
MIT
compatibility
claude-code, cursor
allowed-tools
Read, Bash, Write, WebFetch

CI/CD Deploy Helper

Standardized deployment automation for CI/CD pipelines (GitHub Actions, GitLab CI, Jenkins).

Features

  • Docker image build and push
  • Kubernetes manifest templating (kustomize-style)
  • Database migration runner
  • Environment-specific config generation
  • Deployment health check and rollback
  • Slack/Teams/DingTalk notifications

Usage

# Build and push Docker image
python scripts/deploy.py --action build --tag v1.2.3 --registry harbor.example.com

# Run database migrations
python scripts/deploy.py --action migrate --env staging --db-url $DATABASE_URL

# Deploy to Kubernetes
python scripts/deploy.py --action k8s-deploy --env production --namespace default

# Run health check after deploy
python scripts/deploy.py --action healthcheck --url https://api.example.com/health

# Send deployment notification
python scripts/deploy.py --action notify --status success --env production

Configuration

Deployment config is read from deploy.yaml in the project root:

environments:
  staging:
    registry: harbor-dev.example.com
    k8s_namespace: staging
    db_url_env: STAGING_DATABASE_URL
  production:
    registry: harbor.example.com
    k8s_namespace: production
    db_url_env: DATABASE_URL

Safety

  • Always runs a dry-run first (set --no-dry-run to actually deploy)
  • Requires explicit environment confirmation for production
  • Automatic rollback on health check failure