Skip to content

How do I roll back a bad deploy?

Q: I deployed something broken. How do I get the previous version back?

Every deploy is kept as an immutable release, and rollback is one call:

Terminal window
DEPLOY_URL=https://portal.infoemu.com \
INSTANCE_ID=<your-site-id> \
DEPLOY_TOKEN=dpl_... \
./deploy.sh --rollback

or directly against the API:

Terminal window
curl -sS -X POST -H "Authorization: Bearer $DEPLOY_TOKEN" \
"$DEPLOY_URL/api/deploy/$INSTANCE_ID/rollback"

The switch is atomic — visitors see either the old release or the new one, never a half-updated site. A 409 response means there is no previous release to roll back to (only one release exists so far).

To see what’s on disk and which release is live:

Terminal window
curl -sS -H "Authorization: Bearer $DEPLOY_TOKEN" \
"$DEPLOY_URL/api/deploy/$INSTANCE_ID/releases"