deployment-strategies
Blue-green, canary, rolling deployments, rollback procedures, and deployment verification patterns.
What this skill does
# Deployment Strategies
Safe deployment patterns with verification and rollback.
## Rolling Deployment (Kubernetes)
```bash
# Update image (triggers rolling update)
kubectl set image deployment/myapp myapp=myapp:v2.0
# Watch rollout progress
kubectl rollout status deployment/myapp
# Check rollout history
kubectl rollout history deployment/myapp
# Rollback to previous version
kubectl rollout undo deployment/myapp
# Rollback to specific revision
kubectl rollout undo deployment/myapp --to-revision=3
# Pause/resume rollout
kubectl rollout pause deployment/myapp
kubectl rollout resume deployment/myapp
```
## Blue-Green Deployment
```bash
# Deploy green (new version) alongside blue (current)
kubectl apply -f deployment-green.yaml
# Verify green is healthy
kubectl get pods -l version=green
kubectl exec -it $(kubectl get pod -l version=green -o jsonpath='{.items[0].metadata.name}') -- curl -s localhost:8080/health
# Switch traffic to green
kubectl patch service myapp -p '{"spec":{"selector":{"version":"green"}}}'
# Verify traffic is flowing to green
curl -s https://myapp.example.com/version
# Rollback: switch back to blue
kubectl patch service myapp -p '{"spec":{"selector":{"version":"blue"}}}'
# Cleanup old blue after confidence period
kubectl delete deployment myapp-blue
```
## Canary Deployment
```bash
# Deploy canary (small replica count)
kubectl apply -f deployment-canary.yaml
kubectl scale deployment myapp-canary --replicas=1
# Main deployment stays at full capacity
kubectl get deployment myapp --show-labels
kubectl get deployment myapp-canary --show-labels
# Monitor canary error rate
kubectl logs -l version=canary --tail=100 | grep -c "ERROR"
# Promote canary: scale up canary, scale down main
kubectl scale deployment myapp-canary --replicas=5
kubectl scale deployment myapp --replicas=0
# Or rollback: remove canary
kubectl delete deployment myapp-canary
```
## GitHub Actions Deployment
```bash
# Trigger deployment workflow
gh workflow run deploy.yml -f environment=staging -f version=v2.0
# Watch deployment
gh run watch $(gh run list --workflow=deploy.yml --limit 1 --json databaseId -q '.[0].databaseId')
# Check deployment status
gh api repos/{owner}/{repo}/deployments --jq '.[] | {id, environment: .environment, ref: .ref, created_at: .created_at}' | head -20
```
## Docker Compose (Simple)
```bash
# Pull new images
docker compose pull
# Rolling restart (zero downtime with multiple replicas)
docker compose up -d --no-deps --scale myapp=2 myapp
sleep 10
docker compose up -d --no-deps --scale myapp=1 myapp
# Quick rollback: use previous image tag
docker compose up -d myapp
```
## Post-Deployment Verification
```bash
# Health check
curl -sf https://myapp.example.com/health | jq .
# Smoke test critical endpoints
endpoints=("/api/users" "/api/products" "/api/health")
for ep in "${endpoints[@]}"; do
status=$(curl -s -o /dev/null -w "%{http_code}" "https://myapp.example.com$ep")
echo "$ep: $status"
done
# Check error rate in logs (last 5 minutes)
kubectl logs -l app=myapp --since=5m | grep -c "ERROR"
# Check response times
for i in $(seq 1 5); do
curl -s -o /dev/null -w "TTFB: %{time_starttransfer}s Total: %{time_total}s\n" https://myapp.example.com/
done
```
## Notes
- Always deploy to staging first. Verify before promoting to production.
- Blue-green requires 2x resources during transition. Budget for it.
- Canary catches issues that staging misses (real traffic patterns, data shapes, scale).
- Automated rollback triggers: error rate > 1%, p95 latency > 2x baseline, health check failures.
- Keep at least 3 previous versions available for quick rollback.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.