Skip to content

CICD-176 · Restore a reviewed deployment revision ​

Encyclopedia · Deployment and rollback · All snippets

Previous · CICD-175 · Next · CICD-177

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites protected staging environment and trusted immutable release artifacts.
  • Platforms kubernetes, local-lab.
  • Parameters GOOD_REVISION.

2. Copy the snippet ​

bash
kubectl -n staging rollout undo deployment/web --to-revision="${GOOD_REVISION:?}"
kubectl -n staging rollout status deployment/web --timeout=180s

3. How it works ​

The undo command selects the stored deployment revision. The later rollout check waits for the restored template to converge.

4. Verify the result ​

Only use in non-GitOps environments or coordinate with desired-state reconciliation.

Validation syntax-validated (Bash parse). Status definitions.