<< All versions
Skill v1.0.1
currentAutomated scan100/100dykyi-roman/awesome-claude-code/deployment-knowledge
5 files
──Details
PublishedAugust 25, 2026 at 04:15 AM
Content Hashsha256:6642a41380985f3b...
Git SHA7e1fea8899b7
Bump Typepatch
──Files
Files (1 file, 10.3 KB)
SKILL.md10.3 KBactive
SKILL.md · 453 lines · 10.3 KB
version: "1.0.1" name: deployment-knowledge description: Deployment knowledge base. Provides zero-downtime strategies, blue-green deployment, canary releases, rolling updates, rollback procedures, feature flags, and health check patterns.
Deployment Knowledge Base
Quick reference for deployment strategies, zero-downtime patterns, and release management.
Deployment Strategies
Strategy Comparison
| Strategy | Downtime | Rollback Speed | Risk | Resource Usage | |
|---|---|---|---|---|---|
| Recreate | Yes | Slow | High | 1x | |
| Rolling | No | Medium | Medium | 1.25x | |
| Blue-Green | No | Instant | Low | 2x | |
| Canary | No | Fast | Very Low | 1.1x | |
| A/B Testing | No | Fast | Low | Variable |
┌─────────────────────────────────────────────────────────────────┐│ DEPLOYMENT STRATEGIES │├─────────────────────────────────────────────────────────────────┤│ ││ RECREATE ROLLING BLUE-GREEN CANARY ││ ┌───┐ ┌───┬───┐ ┌───┐ ┌───┐ ┌───┐ ││ │ v1│ │v1 │v1 │ │ v1│ │ v2│ │v1 │ 90% ││ └───┘ └───┴───┘ └───┘ └───┘ └───┘ ││ ↓ ↓ ↓ ↕ ┌───┐ ││ ┌───┐ ┌───┬───┐ Traffic │v2 │ 10% ││ │ v2│ │v2 │v1 │ Switch └───┘ ││ └───┘ └───┴───┘ ││ ↓ ↓ ││ ┌───┬───┐ ││ │v2 │v2 │ ││ └───┴───┘ │└─────────────────────────────────────────────────────────────────┘
Blue-Green Deployment
Overview
Two identical environments (Blue = current, Green = new). Traffic switches instantly.
yaml
# Environment structureenvironments:blue:url: blue.example.comversion: v1.2.3active: truegreen:url: green.example.comversion: v1.2.4active: false# Load balancer configupstream backend {server blue.example.com weight=100;server green.example.com weight=0;}
Deployment Steps
bash
#!/bin/bash# blue-green-deploy.shACTIVE=$(get_active_environment)INACTIVE=$(get_inactive_environment)# 1. Deploy to inactive environmentdeploy_to_environment $INACTIVE $VERSION# 2. Run health checksif ! health_check $INACTIVE; thenecho "Health check failed, aborting"exit 1fi# 3. Run smoke testsif ! smoke_tests $INACTIVE; thenecho "Smoke tests failed, aborting"exit 1fi# 4. Switch trafficswitch_traffic_to $INACTIVE# 5. Verifyif ! verify_deployment $INACTIVE; thenecho "Verification failed, rolling back"switch_traffic_to $ACTIVEexit 1fi# 6. Mark as activeset_active_environment $INACTIVE
Rollback
bash
# Instant rollback - just switch traffic backswitch_traffic_to $PREVIOUS_ACTIVE
Canary Deployment
Traffic Distribution
yaml
# Canary stagesstages:- name: canary-5traffic: 5%duration: 10m- name: canary-25traffic: 25%duration: 30m- name: canary-50traffic: 50%duration: 1h- name: full-rollouttraffic: 100%
Implementation
yaml
# nginx canary configupstream backend {server stable.example.com weight=95;server canary.example.com weight=5;}# Or with cookie-based routingmap $cookie_canary $backend {"true" canary.example.com;default stable.example.com;}
Canary Analysis
yaml
# Automated canary analysisanalysis:metrics:- name: error_ratethreshold: 1%comparison: less_than- name: latency_p99threshold: 500mscomparison: less_than- name: success_ratethreshold: 99%comparison: greater_thanduration: 10minterval: 1mon_failure: rollbackon_success: promote
Rolling Deployment
Configuration
yaml
# Kubernetes-style rolling updatedeployment:replicas: 4strategy:type: RollingUpdaterollingUpdate:maxUnavailable: 1maxSurge: 1
Sequence
Time →Pod 1: [v1][v1][v1][v2][v2][v2][v2]Pod 2: [v1][v1][v1][v1][v2][v2][v2]Pod 3: [v1][v1][v1][v1][v1][v2][v2]Pod 4: [v1][v1][v1][v1][v1][v1][v2]
Zero-Downtime Checklist
Database Migrations
php
// WRONG: Destructive migrationSchema::dropColumn('users', 'old_field');// RIGHT: Backward-compatible migration// Step 1: Add new column (deploy #1)Schema::addColumn('users', 'new_field');// Step 2: Migrate data (deploy #2)DB::statement('UPDATE users SET new_field = old_field');// Step 3: Switch code to use new_field (deploy #3)// Step 4: Drop old column (deploy #4, weeks later)Schema::dropColumn('users', 'old_field');
Migration Strategies
| Change | Strategy | |
|---|---|---|
| Add column | Add with default, deploy, backfill | |
| Remove column | Stop using, deploy, wait, remove | |
| Rename column | Add new, migrate, switch, remove old | |
| Change type | Add new column, migrate, switch | |
| Add index | Online DDL, low-traffic window |
Health Checks
php
// Readiness probe - can accept traffic?public function ready(): JsonResponse{return response()->json(['database' => $this->checkDatabase(),'cache' => $this->checkCache(),'queue' => $this->checkQueue(),]);}// Liveness probe - is the app running?public function live(): JsonResponse{return response()->json(['status' => 'ok']);}
Feature Flags
Implementation Patterns
php
// Simple feature flagif (Feature::enabled('new-checkout')) {return $this->newCheckout();}return $this->oldCheckout();// User-based rolloutif (Feature::enabledForUser('new-checkout', $user)) {return $this->newCheckout();}// Percentage rolloutif (Feature::enabledForPercentage('new-checkout', 10)) {return $this->newCheckout();}
Feature Flag Service
php
interface FeatureFlagService{public function isEnabled(string $feature): bool;public function isEnabledForUser(string $feature, User $user): bool;public function isEnabledForPercentage(string $feature, int $percent): bool;public function getVariant(string $feature): string;}
Configuration
yaml
# features.yamlfeatures:new-checkout:enabled: truerollout:type: percentagevalue: 25users:- user-123 # Beta testers- user-456dark-mode:enabled: truerollout:type: user_attributeattribute: planvalues: [premium, enterprise]
Best Practices
Feature Flag Lifecycle:┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐│ Create │───▶│ Rollout │───▶│ Full On │───▶│ Remove ││ Flag │ │ 0-100% │ │ 100% │ │ Flag │└──────────┘ └──────────┘ └──────────┘ └──────────┘1 day 1-2 weeks 2 weeks Sprint
Rollback Procedures
Automated Rollback Triggers
yaml
rollback:triggers:- metric: error_ratethreshold: 5%window: 5m- metric: latency_p95threshold: 2swindow: 5m- metric: health_check_failuresthreshold: 3window: 1mactions:- switch_traffic_to_previous- notify_oncall- create_incident
Manual Rollback
bash
#!/bin/bash# rollback.sh# 1. Get previous versionPREVIOUS=$(get_previous_version)# 2. Switch traffic immediately (blue-green)switch_traffic_to $PREVIOUS_ENV# Or redeploy previous version (rolling)deploy_version $PREVIOUS# 3. Verifyhealth_check_all# 4. Notifynotify_team "Rolled back to $PREVIOUS"
Database Rollback
php
// Always have down() migrationpublic function down(): void{Schema::table('users', function (Blueprint $table) {$table->dropColumn('new_field');});}
Environment Configuration
Environment Matrix
yaml
environments:development:replicas: 1resources: minimalauto_deploy: truestaging:replicas: 2resources: mediumauto_deploy: truefeature_flags: all_enabledproduction:replicas: 4+resources: fullauto_deploy: falserequires_approval: truedeployment_window: "Mon-Thu 09:00-16:00"
Secrets Management
yaml
# DO NOT: Hardcode secretsdatabase_password: "secret123"# DO: Use environment variablesdatabase_password: ${DATABASE_PASSWORD}# DO: Use secret managersdatabase_password:vault: production/databasekey: password
Deployment Checklist
Pre-Deployment
- [ ] All tests passing
- [ ] Code review approved
- [ ] Database migrations tested
- [ ] Rollback plan documented
- [ ] Monitoring alerts configured
- [ ] Stakeholders notified
During Deployment
- [ ] Health checks passing
- [ ] No error spike in metrics
- [ ] Latency within SLA
- [ ] Smoke tests passing
- [ ] Feature flags working
Post-Deployment
- [ ] Verify functionality
- [ ] Check error rates
- [ ] Monitor performance
- [ ] Update documentation
- [ ] Clean up old versions
References
For detailed information, load these reference files:
references/blue-green.md— Blue-green implementation detailsreferences/canary.md— Canary release patternsreferences/feature-flags.md— Feature flag best practices