360 Secure SkillHub
360 安全技能中心

Skylv Deployment Automation

这是面向DevOps的部署自动化工具,核心功能含蓝绿、金丝雀、滚动等零停机部署策略,内置健康检查,失败自动回滚;支持多环境(Dev→Staging→Prod)部署与配置对比,可推送Slack/邮件等通知。典型场景涵盖生产发布、蓝绿切换、紧急热修复、跨环境部署,通过命令行指令操作,输出部署状态及执行结果,适配CI/CD流程。

sky-lv
sky-lv
热度 45.23
最近更新 2026-05-18 11:50:11
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:DevOps / 自动化脚本 / 工作流

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add skylv-deployment-automation
Metadata
name
deployment-automation
slug
deployment-automation
version
1.0.1
description
Deploy with confidence. Zero-downtime releases with blue-green, canary, or rolling strategies. Auto-rollback on failure.
author
SKY-lv
license
MIT-0
tags
["automation","devops","deployment"]
keywords
["deployment","CI/CD","release automation","deploy pipeline","continuous deployment","zero-downtime","blue-green","canary","rollback"]
triggers
deployment, deploy, CI/CD, release, deploy pipeline, continuous deployment

deployment-automation

Deploy with confidence. Zero-downtime releases, instant rollback, and health checks that catch issues before users do.

What It Does

  • Multi-strategy — Blue-green, canary, or rolling deployments
  • Zero downtime — Health checks before/after each step
  • Auto-rollback — Instant revert on failure
  • Multi-env — Dev → staging → production promotion
  • Notifications — Slack, email, PagerDuty on deploy events

Quick Start

# 1. Create deployment pipeline
node deploy.js pipeline create --name prod --stages build,test,deploy

# 2. Deploy with canary strategy
node deploy.js deploy --strategy canary --service api --canary-percent 10

# 3. Check deployment status
node deploy.js status --service api

# 4. Rollback if needed
node deploy.js rollback --service api --to previous

Common Use Cases

🚀 Production Release

# Deploy with canary (10% traffic first)
node deploy.js deploy --strategy canary --service web --canary-percent 10

# Monitor for 10 minutes, then increase
node deploy.js canary --service web --percent 50
node deploy.js canary --service web --percent 100

🔄 Blue-Green Swap

# Deploy to green environment
node deploy.js deploy --strategy blue-green --service api

# Test green, then swap
node deploy.js swap --service api

# Instant rollback if issues
node deploy.js rollback --service api --to blue

🏥 Hotfix Emergency

# Deploy hotfix with extra verification
node deploy.js deploy --service api --ref hotfix-branch \
  --health-check-timeout 60s \
  --auto-rollback

📈 Promote Across Environments

# Promote staging to production
node deploy.js promote --from staging --to production --approve

# View config differences
node deploy.js diff --env staging vs production

All Commands

Command Purpose
deploy --strategy <s> Deploy with strategy
status --service <name> Check deployment status
rollback --to <version> Revert to previous version
promote --from <env> Promote across environments
diff --env <a> vs <b> Compare environment configs
canary --percent <n> Adjust canary traffic
swap Blue-green swap

Configuration

{
  "pipeline": {
    "environments": ["dev", "staging", "production"],
    "strategy": "canary",
    "canaryPercent": 10,
    "healthCheck": {
      "endpoint": "/health",
      "timeout": "30s",
      "retries": 3
    },
    "rollback": {
      "autoOnFailure": true,
      "maxRetries": 3
    },
    "notifications": {
      "onStart": ["slack"],
      "onSuccess": ["slack", "email"],
      "onFailure": ["slack", "pagerduty"]
    }
  }
}