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"]
}
}
}