⚙️ Automation

Deployment Checklist Generator

Create comprehensive pre-deployment checklists with automated verification

★★☆ Intermediate 15 min January 13, 2025

Use Case

Deployments require systematic verification to prevent issues. Cowork can generate checklists tailored to your stack and create scripts to automate checks.

Example Prompt

I'm deploying a Node.js application to production. Please create:

1. A pre-deployment checklist covering:
   - Code quality (tests, linting)
   - Security (dependencies, secrets)
   - Database (migrations, backups)
   - Infrastructure (resources, configs)
   - Monitoring (alerts, logging)

2. An automated verification script that checks:
   - All tests pass
   - No security vulnerabilities
   - Environment variables set
   - Database connectivity

3. A post-deployment verification checklist

Save to ~/Deployments/checklist/

What Cowork Does

  1. Checklist Generation: Creates comprehensive markdown checklist
  2. Script Creation: Automates verifiable checks
  3. Risk Assessment: Identifies critical checks
  4. Rollback Planning: Includes recovery procedures
  5. Documentation: Generates runbook format

Sample Output

# Production Deployment Checklist
Application: MyApp
Date: ___________
Engineer: ___________

## Pre-Deployment

### Code Quality
- [ ] All tests passing (run: `npm test`)
- [ ] ESLint passes with no errors
- [ ] Code review approved
- [ ] PR merged to main
- [ ] Build successful on CI

### Security
- [ ] `npm audit` shows no high/critical vulnerabilities
- [ ] No secrets in codebase (run: `git secrets --scan`)
- [ ] Dependencies updated in last 30 days
- [ ] HTTPS enforced
- [ ] Rate limiting configured

### Database
- [ ] Database backup completed
- [ ] Backup verified (test restore)
- [ ] Migrations tested on staging
- [ ] Migration rollback script ready
- [ ] Database connection pool sized

### Infrastructure
- [ ] Environment variables set
- [ ] SSL certificates valid (>30 days)
- [ ] Disk space available (>20% free)
- [ ] Memory allocation confirmed
- [ ] Load balancer health checks configured

### Monitoring
- [ ] Error tracking active (Sentry/etc)
- [ ] Performance monitoring enabled
- [ ] Alert thresholds configured
- [ ] On-call engineer notified
- [ ] Status page ready

---

## Deployment Steps
1. Enable maintenance mode
2. Create database backup
3. Run database migrations
4. Deploy new application version
5. Verify health checks
6. Disable maintenance mode
7. Verify in production

---

## Rollback Plan
If issues detected:
1. Enable maintenance mode
2. Revert to previous deployment
3. Rollback database (if needed)
4. Verify functionality
5. Investigate root cause
#!/bin/bash
# pre-deploy-verify.sh

echo "Running pre-deployment verification..."

FAILED=0

# Test suite
echo "Running tests..."
npm test
if [ $? -ne 0 ]; then
    echo "Tests failed"
    FAILED=1
fi

# Security audit
echo "Checking security..."
AUDIT=$(npm audit --json 2>/dev/null)
HIGH=$(echo $AUDIT | jq '.metadata.vulnerabilities.high')
CRITICAL=$(echo $AUDIT | jq '.metadata.vulnerabilities.critical')

if [ "$HIGH" -gt 0 ] || [ "$CRITICAL" -gt 0 ]; then
    echo "Security vulnerabilities found: $HIGH high, $CRITICAL critical"
    FAILED=1
else
    echo "No high/critical vulnerabilities"
fi

# Environment variables
echo "Checking environment..."
REQUIRED_VARS="DATABASE_URL REDIS_URL API_KEY SECRET_KEY"
for var in $REQUIRED_VARS; do
    if [ -z "${!var}" ]; then
        echo "Missing: $var"
        FAILED=1
    fi
done

# Database connectivity
echo "Testing database connection..."
node -e "require('./src/db').connect().then(() => process.exit(0)).catch(() => process.exit(1))"
if [ $? -ne 0 ]; then
    echo "Database connection failed"
    FAILED=1
else
    echo "Database connected"
fi

# Final result
echo ""
if [ $FAILED -eq 0 ]; then
    echo "All pre-deployment checks passed!"
    echo "Proceed with deployment."
else
    echo "Pre-deployment checks failed!"
    echo "Fix issues before deploying."
    exit 1
fi

Tips

  • Customize checklist for your specific stack
  • Make critical items blockers in CI/CD
  • Keep rollback procedures updated
  • Practice deployments in staging first