Skip to content

Promote and roll back

Moving an environment to another deploy: instantly, with a health check, gradually, or backwards.

Applies to EngineCloud
View as Markdown
On this page
  1. Commands
  2. How a release happens
  3. Gradual releases
  4. Automatic rollback
  5. What a rollback does not undo

Releasing never rebuilds anything: it changes which deploy an environment points to.

Commands

Terminal
npx @sypnia/run promote dpl_7h3k --env production   # send production to this deploy
npx @sypnia/run rollback                            # production back to the deploy before the current one
npx @sypnia/run rollback --to dpl_5a1q              # to a specific deploy

How a release happens

  1. The target deploy must be ready: built, with its resources created, and answering its health check at its own address.
  2. The edge router’s mapping for the environment changes to the target deploy. CloudFront applies it within seconds worldwide.
  3. Requests already in progress finish on the deploy that started them.
  4. The release is recorded: who, when, from which deploy to which, and why (--reason).

Gradual releases

--gradual 10% sends a share of new visitors to the new deploy and keeps the rest on the old one, sticky per visitor. run promote --continue moves the rest; run rollback sends everyone back. While a gradual release is on, Sypnia Telemetry compares errors and latency of both deploys.

Automatic rollback

With release.auto_rollback on, Run watches the new deploy’s error rate for ten minutes after the release, through Sypnia Telemetry or the platform’s own logs, and moves production back if it rises past the threshold you set. The rollback is recorded and you are notified.

What a rollback does not undo

Database migrations, files written to storage and e-mails sent are outside the deploy. Keep migrations backward compatible for one release, so the previous deploy still works with the new schema.

  1. Commands
  2. How a release happens
  3. Gradual releases
  4. Automatic rollback
  5. What a rollback does not undo

    Search pages, sections and terms