Promote and roll back
Moving an environment to another deploy: instantly, with a health check, gradually, or backwards.
Releasing never rebuilds anything: it changes which deploy an environment points to.
Commands
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 deployHow a release happens
- The target deploy must be
ready: built, with its resources created, and answering its health check at its own address. - The edge router’s mapping for the environment changes to the target deploy. CloudFront applies it within seconds worldwide.
- Requests already in progress finish on the deploy that started them.
- 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.