DocsDeploying
Versions and rollbacks
Versions
Every snapwake deploy and snapwake redeploy creates a version. Its id is v followed by the time it was created in milliseconds, for example v1764158400123. A version is one of:
| State | Meaning |
|---|---|
building |
the home server is building it, or booting it for the first time |
ready |
built and answering; it can be the current version |
failed |
the build failed or the app never started listening; the note says why |
The current version is the one that serves requests. A new version becomes current as soon as it is ready. Until then, and forever if it fails, the previous current version keeps serving.
snapwake status <app> lists the last five versions and marks the current one with *:
shop n2 v1764158400123 awake 1 ok
processes: web 512 MB, 0-1 VMs
* v1764158400123 ready upload:9f2c...
v1764151100456 ready upload:41ab...
v1764150000789 failed upload:77de... the app did not listen on port 3000Snapwake remembers your last ten versions. The servers keep the files of the current version and the one before it.
What belongs to a version and what doesn't
A version is the built image and its snapshot: your code, its dependencies, and the result of the build.
These belong to the app and apply to every version, including one you roll back to:
- secrets and environment variables;
- port, start command and memory;
- scaling (
min,max,concurrency) and the health check; - volumes and the data on them.
So if a new version needed a new port or a new secret, rolling back does not undo that change. Change it back yourself.
Redeploy
snapwake redeploy shopBuilds a new version from the same source as the current one: the same image reference (pulled again, so a moved tag like :latest picks up the new image) or the same uploaded folder, with the same Dockerfile and build arguments. Use it after changing secrets, so the app starts with the new values, or to pick up a new image behind the same tag.
Rollback
snapwake rollback shopMakes the previous version current again. Its files are still on the servers, so the switch takes effect right away: the next request, or the next wake, goes to that version. Rolling back again returns to the version you rolled back from.
A rollback does not rebuild anything and does not change the app's settings (see above).
What a deploy looks like to your users
- Apps without volumes: no downtime. The new version boots next to the old one and takes over when it answers. VMs of the old version finish the requests they are serving, then stop. They get up to 60 seconds for that: a request or stream still open after that is cut.
- Apps with volumes: a short pause. Only one VM may write to a volume, so the old VM stops before the new version boots with the volume. Requests during that time wait.
The snapshot that later wakes start from is taken in the background after the switch, from a second, clean boot of the new version. Until it is ready, the VM that took over keeps serving and does not go to sleep.