0
0
Firebasecloud~10 mins

Rollback deployments in Firebase - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Rollback deployments
Start Deployment
Deploy New Version
Check Deployment Status
Keep
Deploy Previous Version
Deployment Stable
End
This flow shows deploying a new version, checking if it works, and rolling back to the previous version if it fails.
Execution Sample
Firebase
firebase deploy --only hosting
# Check deployment
# If failure, run:
firebase hosting:channel:rollback
Deploys a new hosting version, then rolls back if deployment fails.
Process Table
StepActionDeployment VersionStatus CheckResult
1Deploy new version v2v2PendingDeployment started
2Check deployment statusv2FailedTrigger rollback
3Rollback to previous version v1v1SuccessDeployment stable
4End processv1N/ARollback complete, stable version running
💡 Rollback completed because new deployment v2 failed status check
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Deployment Versionv1v2v2v1v1
Deployment StatusStablePendingFailedStableStable
Key Moments - 3 Insights
Why do we deploy version v2 before checking if it works?
Because deployment must happen first to test if the new version is stable, as shown in step 1 and 2 of the execution_table.
What happens if the deployment status is successful?
If successful, rollback is not triggered and the new version stays live, but in this example, failure caused rollback at step 2.
Does rollback deploy the exact previous version?
Yes, rollback redeploys the last stable version, here v1, as shown in step 3.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the deployment version after step 3?
Av2
Bv3
Cv1
DNone
💡 Hint
Check the 'Deployment Version' column at step 3 in the execution_table.
At which step does the deployment status become 'Failed'?
AStep 1
BStep 2
CStep 3
DStep 4
💡 Hint
Look at the 'Deployment Status' column in the variable_tracker after step 2.
If the deployment status was 'Success' at step 2, what would happen next?
AKeep new version live
BRollback to previous version
CDeploy a new version v3
DEnd with failure
💡 Hint
Refer to the concept_flow where success leads to keeping the new version.
Concept Snapshot
Rollback deployments:
- Deploy new version
- Check if deployment works
- If fails, rollback to previous stable version
- Use 'firebase hosting:channel:rollback' to revert
- Ensures stable live environment
Full Transcript
This visual execution shows how deploying a new Firebase hosting version works. First, a new version is deployed. Then the deployment status is checked. If the deployment fails, a rollback is triggered to redeploy the previous stable version. This process ensures the live site stays stable. The execution table traces each step, showing deployment versions and status changes. Key moments clarify why deployment happens before checking and how rollback restores stability. The quiz tests understanding of deployment versions and status at each step.