Skip to content

Rollbacks

Every deployment produces an immutable container image that is retained in your cloud provider’s registry. Rolling back reactivates a previous image — no rebuild required.

Terminal window
ske rollback
⠋ Rolling back to deployment #41...
✓ Rollback succeeded (45s)

By default, ske rollback reverts to the latest deploy before the one that built what runs now, skipping any that ran the same image or can no longer be rolled back to. Running it again after a rollback goes further back, never forward.

Use --to to target a specific deployment:

Terminal window
ske rollback --to 38
⠋ Rolling back to deployment #38...
✓ Rollback succeeded (42s)

Find the deployment ID with ske deploy list:

Terminal window
ske deploy list
ID TYPE STATUS INITIATOR CREATED
42 deploy succeeded you@example.com 2026-09-20 14:30
41 deploy succeeded you@example.com 2026-09-19 09:15
40 rollback succeeded you@example.com 2026-09-18 16:00
39 deploy succeeded ci@example.com 2026-09-17 12:00
38 deploy succeeded ci@example.com 2026-09-16 14:00

A rollback creates a new deployment record of type rollback. It does not delete the deployment you’re rolling back from — that image remains available for future use.

The rollback process:

  1. Locates the target deployment’s container image in your registry
  2. Updates the compute configuration (Lambda function or Cloud Run service) to use that image
  3. Routes traffic to the rolled-back version

Because the image already exists in your registry, rollbacks take under a minute instead of the full build-push-provision cycle.

Your registry keeps the 25 most recent images: per project on AWS (ECR lifecycle policy), per environment on GCP (Artifact Registry cleanup policy). The image each environment runs now is tagged ske-live-<environment> and is never expired, however many images are pushed after it.

On AWS, each Lambda function also keeps its 25 most recent versions. Every deploy, redeploy, env sync and maintenance toggle publishes a new version. On GCP, Cloud Run caps how many revisions a service keeps and deletes the oldest past that.

You can roll back to a successful deploy as long as its image and its function versions (or Cloud Run revisions) are all still there. A rollback must target a deploy, not another rollback, env sync or maintenance toggle. A rollback to an older deploy is refused, because there would be nothing left to run.

Each deployment’s static assets stay in the environment’s assets bucket for as long as you can roll back to it. After a successful deploy, SKE deletes the assets of deployments you can no longer roll back to. The assets of what runs now are never deleted.

Rollbacks revert the application code. They do not revert:

  • Secrets — secret values are applied at container startup from your cloud provider’s secret store. A rollback uses the current secrets, not the ones that were set at the time of the original deployment.
  • Infrastructure — databases, caches, networks, and their configurations are not affected.
  • Database migrations — if the deployment you’re rolling back from ran migrations, those changes remain. Make sure your migrations are backward-compatible.
Terminal window
# Roll back production to deployment 38
ske rollback --to 38 --env production --json

The --json flag outputs machine-readable JSON for pipeline integrations.