deployment-checklist-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Deployment Checklist Generator

部署检查清单生成器

Ensure safe, reliable deployments with comprehensive checklists.
通过全面的检查清单确保部署安全可靠。

Pre-Deployment Checklist

部署前检查清单

markdown
undefined
markdown
undefined

Pre-Deployment Checklist

部署前检查清单

Code Quality

代码质量

  • All CI checks passing
  • Code review approved (2+ reviewers)
  • No known critical bugs
  • Security scan passed
  • Performance tests passed
  • 所有CI检查已通过
  • 代码评审已获批(2名及以上评审人)
  • 无已知严重漏洞
  • 安全扫描已通过
  • 性能测试已通过

Dependencies

依赖项

  • All dependencies up to date
  • No high/critical vulnerabilities
  • Bundle size within budget
  • Third-party services operational
  • 所有依赖项已更新
  • 无高/严重级漏洞
  • 包体积在预算范围内
  • 第三方服务运行正常

Database

数据库

  • Migrations tested in staging
  • Backup completed
  • Rollback plan documented
  • Data migration scripts reviewed
  • 迁移脚本已在预发布环境测试
  • 备份已完成
  • 回滚计划已文档化
  • 数据迁移脚本已评审

Infrastructure

基础设施

  • Servers have capacity
  • CDN cache invalidation plan
  • Load balancer configured
  • SSL certificates valid
  • 服务器有足够容量
  • CDN缓存失效计划已制定
  • 负载均衡器已配置
  • SSL证书有效

Documentation

文档

  • Changelog updated
  • API docs updated (if changed)
  • Deployment notes prepared
  • Rollback instructions ready
  • 更新日志已更新
  • API文档已更新(若有变更)
  • 部署说明已准备
  • 回滚说明已就绪

Communication

沟通

  • Stakeholders notified
  • Maintenance window scheduled (if needed)
  • Support team briefed
  • Status page prepared
  • 已通知相关干系人
  • 已安排维护窗口(若需要)
  • 已向支持团队交底
  • 状态页面已准备

Deployment Window

部署窗口

  • Off-peak hours selected
  • Team available for monitoring
  • Emergency contacts confirmed
undefined
  • 已选择非高峰时段
  • 团队成员可随时监控
  • 紧急联系人已确认
undefined

Deployment Workflow with Checks

带检查环节的部署工作流

yaml
undefined
yaml
undefined

.github/workflows/deploy.yml

.github/workflows/deploy.yml

name: Deploy to Production
on: workflow_dispatch:
jobs: pre-deploy-checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
  - name: Check branch
    run: |
      if [ "${{ github.ref }}" != "refs/heads/main" ]; then
        echo "❌ Can only deploy from main branch"
        exit 1
      fi

  - name: Verify CI passed
    uses: actions/github-script@v7
    with:
      script: |
        const checks = await github.rest.checks.listForRef({
          owner: context.repo.owner,
          repo: context.repo.repo,
          ref: context.sha,
        });

        const failed = checks.data.check_runs.filter(
          check => check.conclusion === 'failure'
        );

        if (failed.length > 0) {
          throw new Error(`CI checks failed: ${failed.map(c => c.name).join(', ')}`);
        }

  - name: Check deployment window
    run: |
      HOUR=$(date +%H)
      if [ $HOUR -ge 9 ] && [ $HOUR -le 17 ]; then
        echo "⚠️ Deploying during business hours"
      else
        echo "✅ Deploying outside business hours"
      fi

  - name: Verify staging deployment
    run: |
      if ! curl -f https://staging.myapp.com/health; then
        echo "❌ Staging is not healthy"
        exit 1
      fi
deploy: needs: pre-deploy-checks runs-on: ubuntu-latest environment: name: production url: https://myapp.com steps: - uses: actions/checkout@v4
  - name: Backup database
    run: ./scripts/backup-db.sh

  - name: Deploy
    run: ./scripts/deploy.sh production

  - name: Run smoke tests
    run: ./scripts/smoke-tests.sh production

  - name: Update status page
    run: |
      curl -X POST https://statuspage.io/api/v1/incidents \
        -H "Authorization: Bearer ${{ secrets.STATUSPAGE_TOKEN }}" \
        -d '{"name":"Deployment Complete","status":"resolved"}'

  - name: Create deployment record
    uses: actions/github-script@v7
    with:
      script: |
        github.rest.repos.createDeployment({
          owner: context.repo.owner,
          repo: context.repo.repo,
          ref: context.sha,
          environment: 'production',
          description: 'Production deployment',
        });
undefined
name: Deploy to Production
on: workflow_dispatch:
jobs: pre-deploy-checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
  - name: Check branch
    run: |
      if [ "${{ github.ref }}" != "refs/heads/main" ]; then
        echo "❌ Can only deploy from main branch"
        exit 1
      fi

  - name: Verify CI passed
    uses: actions/github-script@v7
    with:
      script: |
        const checks = await github.rest.checks.listForRef({
          owner: context.repo.owner,
          repo: context.repo.repo,
          ref: context.sha,
        });

        const failed = checks.data.check_runs.filter(
          check => check.conclusion === 'failure'
        );

        if (failed.length > 0) {
          throw new Error(`CI checks failed: ${failed.map(c => c.name).join(', ')}`);
        }

  - name: Check deployment window
    run: |
      HOUR=$(date +%H)
      if [ $HOUR -ge 9 ] && [ $HOUR -le 17 ]; then
        echo "⚠️ Deploying during business hours"
      else
        echo "✅ Deploying outside business hours"
      fi

  - name: Verify staging deployment
    run: |
      if ! curl -f https://staging.myapp.com/health; then
        echo "❌ Staging is not healthy"
        exit 1
      fi
deploy: needs: pre-deploy-checks runs-on: ubuntu-latest environment: name: production url: https://myapp.com steps: - uses: actions/checkout@v4
  - name: Backup database
    run: ./scripts/backup-db.sh

  - name: Deploy
    run: ./scripts/deploy.sh production

  - name: Run smoke tests
    run: ./scripts/smoke-tests.sh production

  - name: Update status page
    run: |
      curl -X POST https://statuspage.io/api/v1/incidents \
        -H "Authorization: Bearer ${{ secrets.STATUSPAGE_TOKEN }}" \
        -d '{"name":"Deployment Complete","status":"resolved"}'

  - name: Create deployment record
    uses: actions/github-script@v7
    with:
      script: |
        github.rest.repos.createDeployment({
          owner: context.repo.owner,
          repo: context.repo.repo,
          ref: context.sha,
          environment: 'production',
          description: 'Production deployment',
        });
undefined

Smoke Test Script

冒烟测试脚本

bash
#!/bin/bash
bash
#!/bin/bash

scripts/smoke-tests.sh

scripts/smoke-tests.sh

ENVIRONMENT=$1 BASE_URL="https://${ENVIRONMENT}.myapp.com"
echo "🔍 Running smoke tests for $ENVIRONMENT..."
FAILED=0
ENVIRONMENT=$1 BASE_URL="https://${ENVIRONMENT}.myapp.com"
echo "🔍 Running smoke tests for $ENVIRONMENT..."
FAILED=0

Test 1: Health endpoint

Test 1: Health endpoint

echo "Test 1: Health check" if curl -f "$BASE_URL/health" | grep -q "ok"; then echo "✅ Health check passed" else echo "❌ Health check failed" FAILED=1 fi
echo "Test 1: Health check" if curl -f "$BASE_URL/health" | grep -q "ok"; then echo "✅ Health check passed" else echo "❌ Health check failed" FAILED=1 fi

Test 2: User authentication

Test 2: User authentication

echo "Test 2: User login" TOKEN=$(curl -s -X POST "$BASE_URL/api/auth/login"
-H "Content-Type: application/json"
-d '{"email":"test@example.com","password":"test123"}'
| jq -r '.token')
if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ]; then echo "✅ Login passed" else echo "❌ Login failed" FAILED=1 fi
echo "Test 2: User login" TOKEN=$(curl -s -X POST "$BASE_URL/api/auth/login"
-H "Content-Type: application/json"
-d '{"email":"test@example.com","password":"test123"}'
| jq -r '.token')
if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ]; then echo "✅ Login passed" else echo "❌ Login failed" FAILED=1 fi

Test 3: Critical API endpoints

Test 3: Critical API endpoints

echo "Test 3: API endpoints" ENDPOINTS=("/api/users" "/api/products" "/api/orders")
for endpoint in "${ENDPOINTS[@]}"; do STATUS=$(curl -s -o /dev/null -w "%{http_code}"
-H "Authorization: Bearer $TOKEN"
"$BASE_URL$endpoint")
if [ "$STATUS" == "200" ]; then echo "✅ $endpoint: $STATUS" else echo "❌ $endpoint: $STATUS" FAILED=1 fi done
echo "Test 3: API endpoints" ENDPOINTS=("/api/users" "/api/products" "/api/orders")
for endpoint in "${ENDPOINTS[@]}"; do STATUS=$(curl -s -o /dev/null -w "%{http_code}"
-H "Authorization: Bearer $TOKEN"
"$BASE_URL$endpoint")
if [ "$STATUS" == "200" ]; then echo "✅ $endpoint: $STATUS" else echo "❌ $endpoint: $STATUS" FAILED=1 fi done

Test 4: Database connectivity

Test 4: Database connectivity

echo "Test 4: Database check" if curl -f "$BASE_URL/api/health/db" | grep -q "connected"; then echo "✅ Database connected" else echo "❌ Database connection failed" FAILED=1 fi
echo "Test 4: Database check" if curl -f "$BASE_URL/api/health/db" | grep -q "connected"; then echo "✅ Database connected" else echo "❌ Database connection failed" FAILED=1 fi

Test 5: External services

Test 5: External services

echo "Test 5: External services" SERVICES=("stripe" "sendgrid" "aws")
for service in "${SERVICES[@]}"; do if curl -f "$BASE_URL/api/health/$service" | grep -q "ok"; then echo "✅ $service: connected" else echo "❌ $service: connection failed" FAILED=1 fi done
if [ $FAILED -eq 1 ]; then echo "❌ Smoke tests failed" exit 1 fi
echo "✅ All smoke tests passed" exit 0
undefined
echo "Test 5: External services" SERVICES=("stripe" "sendgrid" "aws")
for service in "${SERVICES[@]}"; do if curl -f "$BASE_URL/api/health/$service" | grep -q "ok"; then echo "✅ $service: connected" else echo "❌ $service: connection failed" FAILED=1 fi done
if [ $FAILED -eq 1 ]; then echo "❌ Smoke tests failed" exit 1 fi echo "✅ All smoke tests passed" exit 0
undefined

Post-Deployment Verification

部署后验证

markdown
undefined
markdown
undefined

Post-Deployment Verification

部署后验证

Immediate Checks (0-5 minutes)

即时检查(0-5分钟)

  • Deployment completed successfully
  • All smoke tests passed
  • Health checks returning 200
  • No 5xx errors in logs
  • Application responding
  • 部署已成功完成
  • 所有冒烟测试已通过
  • 健康检查返回200状态码
  • 日志中无5xx错误
  • 应用可正常响应

Short-term Monitoring (5-30 minutes)

短期监控(5-30分钟)

  • Error rate <1%
  • Response time p95 <500ms
  • CPU usage normal (<70%)
  • Memory usage stable
  • Database queries performing well
  • 错误率<1%
  • p95响应时间<500ms
  • CPU使用率正常(<70%)
  • 内存使用稳定
  • 数据库查询性能正常

Feature Verification

功能验证

  • Login/authentication working
  • Checkout flow functional
  • Search returning results
  • Email notifications sending
  • Payment processing working
  • 登录/认证功能正常
  • 结账流程可用
  • 搜索功能可返回结果
  • 邮件通知可正常发送
  • 支付处理功能正常

Metrics Dashboard

指标仪表盘

  • Request volume normal
  • Success rate >99%
  • Latency within SLA
  • No spike in errors
  • User engagement stable
  • 请求量正常
  • 成功率>99%
  • 延迟符合SLA要求
  • 无错误激增
  • 用户活跃度稳定

Long-term Monitoring (1-24 hours)

长期监控(1-24小时)

  • No user complaints
  • Support tickets normal
  • Revenue tracking normal
  • All scheduled jobs running
  • No memory leaks detected
undefined
  • 无用户投诉
  • 支持工单数量正常
  • 收入跟踪正常
  • 所有定时任务正常运行
  • 未检测到内存泄漏
undefined

Sign-off Template

审批模板

yaml
- name: Request deployment approval
  uses: trstringer/manual-approval@v1
  with:
    secret: ${{ secrets.GITHUB_TOKEN }}
    approvers: tech-lead,ops-manager
    minimum-approvals: 2
    issue-title: "Approve Production Deployment"
    issue-body: |
      ## Deployment Details

      **Version:** ${{ github.ref_name }}
      **Commit:** ${{ github.sha }}
      **Changes:** See [changelog](CHANGELOG.md)

      ## Pre-deployment Checklist
      - ✅ All CI checks passed
      - ✅ Code review completed
      - ✅ Security scan passed
      - ✅ Staging verified

      ## Approval Required
      This deployment requires approval from tech lead and ops manager.

      **Approve:** Comment "approve" or "lgtm"
      **Reject:** Comment "reject" or "block"
yaml
- name: Request deployment approval
  uses: trstringer/manual-approval@v1
  with:
    secret: ${{ secrets.GITHUB_TOKEN }}
    approvers: tech-lead,ops-manager
    minimum-approvals: 2
    issue-title: "Approve Production Deployment"
    issue-body: |
      ## Deployment Details

      **Version:** ${{ github.ref_name }}
      **Commit:** ${{ github.sha }}
      **Changes:** See [changelog](CHANGELOG.md)

      ## Pre-deployment Checklist
      - ✅ All CI checks passed
      - ✅ Code review completed
      - ✅ Security scan passed
      - ✅ Staging verified

      ## Approval Required
      This deployment requires approval from tech lead and ops manager.

      **Approve:** Comment "approve" or "lgtm"
      **Reject:** Comment "reject" or "block"

Monitoring Dashboard

监控仪表盘

markdown
undefined
markdown
undefined

Deployment Monitoring Dashboard

部署监控仪表盘

Key Metrics

核心指标

Health

健康状态

  • API Health: ✅ UP
  • Database: ✅ Connected
  • Cache: ✅ Connected
  • API Health: ✅ UP
  • Database: ✅ Connected
  • Cache: ✅ Connected

Performance

性能指标

  • Requests/min: 1,234
  • Error rate: 0.2%
  • p50 latency: 120ms
  • p95 latency: 450ms
  • p99 latency: 1,200ms
  • Requests/min: 1,234
  • Error rate: 0.2%
  • p50 latency: 120ms
  • p95 latency: 450ms
  • p99 latency: 1,200ms

Infrastructure

基础设施指标

  • CPU: 45%
  • Memory: 62%
  • Disk: 38%
  • CPU: 45%
  • Memory: 62%
  • Disk: 38%

Business Metrics

业务指标

  • Active users: 523
  • Successful checkouts: 89/hour
  • Revenue: $15,234/hour
  • Active users: 523
  • Successful checkouts: 89/hour
  • Revenue: $15,234/hour

Alerts

告警

No active alerts
无活跃告警

Recent Deployments

最近部署记录

  • v1.3.0: Deployed 5 minutes ago ✅
  • v1.2.9: Deployed 2 days ago ✅
  • v1.2.8: Rolled back 3 days ago ⚠️
undefined
  • v1.3.0: 5分钟前部署 ✅
  • v1.2.9: 2天前部署 ✅
  • v1.2.8: 3天前回滚 ⚠️
undefined

Best Practices

最佳实践

  1. Automated checks: Enforce via CI/CD
  2. Manual review: Critical deployments need approval
  3. Smoke tests: Verify key functionality
  4. Gradual rollout: Canary or blue-green
  5. Monitoring: Watch metrics for 30 minutes
  6. Communication: Keep stakeholders informed
  7. Rollback ready: One-click rollback available
  1. 自动化检查:通过CI/CD强制执行
  2. 人工评审:关键部署需要审批
  3. 冒烟测试:验证核心功能
  4. 渐进式发布:采用金丝雀发布或蓝绿部署
  5. 监控:持续监控指标30分钟
  6. 沟通:及时告知干系人
  7. 回滚就绪:提供一键回滚能力

Output Checklist

输出检查清单

  • Pre-deployment checklist
  • Deployment workflow with gates
  • Smoke test script
  • Post-deployment verification
  • Sign-off workflow
  • Monitoring dashboard
  • Communication templates
  • Rollback instructions
  • 部署前检查清单
  • 带门禁的部署工作流
  • 冒烟测试脚本
  • 部署后验证清单
  • 审批工作流
  • 监控仪表盘
  • 沟通模板
  • 回滚说明