Implement Switch & Rollback
DCD-6 Order: #6 Elaboration Has Dependencies
Updated 3 months, 3 weeks ago
Guidance
Implement Switch & Rollback
Objective
Ensure traffic switch and rollback work reliably end-to-end. Mechanism depends on deployment style.
Path Selection
| Style | Switch | Rollback |
|---|---|---|
| EKS | make switch → infra traffic-switch (Route53 weights) |
make rollback → infra traffic-rollback |
| Elastic Beanstalk | make swap → promote-prod.sh (CNAME swap) |
Another CNAME swap — previous version still running on other env |
EKS Path
Verify make switch and make rollback delegate to infra repo. Create .github/workflows/rollback.yml with confirmation gate calling make rollback.
Elastic Beanstalk Path
Skill: AWS EB Blue/Green Deployment
1. Verify make swap
swap: ## Promote idle → prod
bash scripts/promote-prod.sh
Test: deploy to idle → make swap → prod /health/ revision matches.
2. EB Rollback = Second Swap
No Helm rollback or Route53 weight change. The previously-live env still runs the old image:
# If prod is bad after swap:
make swap # swaps back — old env becomes prod again
Document: rollback time ≈ CNAME swap + 90s DNS + smoke poll (~3 min max).
3. Create promote.yml (GitHub)
name: Promote to Production
on:
workflow_dispatch:
inputs:
expected_revision:
description: 'Release tag or EB VersionLabel (optional)'
required: false
jobs:
promote:
environment: production # approval gate
steps:
- run: bash scripts/promote-prod.sh
env:
EB_APP: {project}
EB_ENV_A: {project}-prod
EB_ENV_B: {project}-idle
EXPECTED_REVISION: ${{ inputs.expected_revision }}
MIMIR_PROD_URL: https://app.example.com
4. Optional Emergency Rollback Workflow
.github/workflows/rollback.yml — same as promote (another swap), with confirmation input type "rollback".
5. Runbook
Document in README:
- Promote: review idle URL → gh workflow run promote.yml or make swap
- Rollback: make swap again (no redeploy needed)
- When: smoke fails after promote, user reports, monitoring alerts
Deliverables
- ✅ Switch verified for chosen style
- ✅ EB: rollback documented as second CNAME swap
- ✅
promote.ymlwith production approval gate - ✅ Optional
rollback.ymlwith confirmation - ✅ Runbook documented
- ✅ Rollback time measured (< 3 min for EB)
Details
- Order:
- #6
- Phase:
- Predecessor:
- DCD-5 Build CD Pipeline
- Created:
- Apr 12, 2026
- Last Updated:
- May 29, 2026
Workflow
Design & Deploy CICD
Design and deploy CI/CD pipeline using GitHub Actions in the application monorepo. Create Helm chart with per-environment values, add container …
View WorkflowAssigned Agent
No agent assigned
Required Skills
- AWS Elastic Beanstalk Blue/Green Deployment
- GitHub Actions Patterns CI_CD GitHub Actions
Rules
No rules linked.
Input Artifacts 3
-
CD Pipeline (GitHub Actions)
Document
Required
Produced by: Build CD Pipeline -
CI Pipeline (GitHub Actions)
Document
Required
Produced by: Build CI Pipeline -
Helm Chart Template
Template
Required
Produced by: Create Helm Chart & Values
Output Artifacts
No output artifacts