Deploy, promote and roll back releases
Start a release with Deploy a branch, Rebuild or Redeploy, promote a preview, roll back to an earlier release, and send part of the traffic to a new one.
In the dashboard
A release is one version of a deployment: a build of a commit, a container image, or the files of a static site. Each push to the production branch starts one, and you can start one yourself. The release that serves production is the live release. A new release builds and starts beside it, and the live release keeps serving until the new one passes its health check, so visitors never see the switch. The Releases tab lists every release, production and previews, newest first.
A game server or a database has no releases: you change its software on its Software tab instead (Change the server software). A server that clones a git repository, such as a Node.js or Python server with a Git address, has releases of its own kind, which put a commit on the server and keep its other files (Update a server from its git repository).
Before you begin
Section titled Before you begin- The deployment builds from a git repository or runs a container image, or it is a static site or a hybrid site.
- You can change the deployment. In an organization, owners and admins start releases, and other members read them.
- Builds are billed by the minute after the free amount each month. A deployment billed by use has no plan limit on builds at once. On older terms your plan sets how many of your builds run at once, and the rest wait their turn (How App Deployment is billed).
The three ways to start a release
Section titled The three ways to start a releaseThree actions start a release. Each has one name and one meaning, in the dashboard and in the API.
| Action | Use it when | What it does | API |
|---|---|---|---|
| Deploy a branch… | You have new code, or want to build another branch, a tag or a commit. | Builds the branch, tag or commit you name, then replaces the live release once the new release is healthy. | POST /releases |
| Rebuild… | A build setting or a build-time variable changed, such as a variable whose name starts with NEXT_PUBLIC_. |
Builds the newest commit on the production branch again, then replaces the live release once the new release is healthy. | POST /redeploy with {"rebuild": true} |
| Redeploy… | A variable the running app reads, or the instance size, changed. | Runs the live release again with the variables, size and locations saved now. Nothing is built or pulled. | POST /redeploy with {"rebuild": false} |
A deployment that runs a container image reads Deploy an image… in place of Deploy a branch…, and Pull again… in place of Rebuild…. Pull again… pulls the image saved in Settings again, with any new push under its tag.
Rebuild…, Pull again… and Redeploy… work on the live release. They appear at the top of the page once the deployment has one.
A build reads the build settings and the variables whose Available at is Build only or Build and runtime, so only a rebuild applies a change to them. A running instance reads everything else, so a redeploy applies it.
After you save a change, a notice at the top of the page names the action and has its button: Rebuild to apply your changes, Pull again to apply your changes or Redeploy to apply your changes. While nothing is live yet, it says Your changes apply with the first release.
All three actions replace the live release only when the new release passes its health check. If it fails, the live release keeps serving.
The API paths in the table start with /api/v1/client/deployments/{uuid}. For an organization's deployment they start with /api/v1/orgs/{org_slug}/deployments/{uuid} (With the API).
Deploy a branch
Section titled Deploy a branch- In the dashboard, go to App Deployment and open the deployment.
- Select Deploy a branch… at the top of the page, on the Releases tab or on the Overview tab. For an image deployment, select Deploy an image…. A page opens, titled Deploy a branch, tag or commit, or Deploy an image. Cancel and the link at the top go back to the page you came from.
- For a deployment built from git, type a branch, a tag or a commit under Branch, tag or commit, or leave it empty to build the newest commit on the production branch. A commit takes its full ID. For an image, type the image under Image, or leave it empty to deploy the image saved in Settings.
- For a deployment built from git, choose where the release goes under Where it goes. Production takes over from the live release once it is ready. Preview, which a branch other than the production branch picks for you, builds that branch at its own address and leaves production as it is; it needs previews turned on (Turn on previews).
- Select Deploy, or Deploy preview. The What happens next card beside the form names the branch or image, where it goes and what happens to the live release.
With the API, send POST /api/v1/client/deployments/{uuid}/releases (With the API).
A message says Release started., or Preview started. for a preview, and the release's page opens with its build log. The log follows the build as it is written, and secret values are hidden in it. A release is queued, then built in a build container of its own (How a release is built), then its instances start, and it goes live once they pass their health check. Its Details show the Runtime its instances run on, such as Node 22, and the size of its Build output; a release of a container image shows the Image instead.
Rebuild
Section titled RebuildRebuild after something the build reads has changed: a build setting on the Settings tab, such as the framework, a command or the directory, or a variable whose Available at is Build only or Build and runtime. A variable such as NEXT_PUBLIC_API_URL is written into the built files, so only a new build picks up its new value.
- Save the change on the Settings or Variables tab.
- In the dashboard, go to App Deployment, open the deployment and select Rebuild… at the top of the page, or the same button in the notice that says Rebuild to apply your changes. For an image deployment, select Pull again….
- In the dialog, select Rebuild. For an image deployment, select Pull again.
A message says Rebuild started. (Pull started. for an image), and the new release's page opens. The release builds the newest commit on the production branch, with the build settings and variables saved now. For an image, it pulls the image saved in Settings again. The live release keeps serving until the new release passes its health check, and then the new release becomes the live release.
With the API, send POST /api/v1/client/deployments/{uuid}/redeploy with {"rebuild": true} (With the API).
Note
A rebuild builds the branch again, so it picks up commits pushed since the live release was built. To run the live release again without building, use Redeploy….
Redeploy
Section titled RedeployRedeploy after a change that only a running instance reads: a variable whose Available at is Runtime only, or the instance size. A change to the locations or to the number of instances applies at once, so it needs no redeploy (Choose locations and scaling).
- Save the change.
- In the dashboard, go to App Deployment, open the deployment and select Redeploy… at the top of the page, or the same button in the notice that says Redeploy to apply your changes.
- In the dialog, select Redeploy.
A message says Redeploy started., and the new release's page opens. The release runs the live release's build output or image again, with the variables, size and locations saved now. Nothing is built or pulled, so it is quicker than a rebuild and it uses no build minutes. The live release keeps serving until the new release is healthy.
With the API, send POST /api/v1/client/deployments/{uuid}/redeploy with {"rebuild": false} (With the API).
What success looks like
Section titled What success looks likeEach action adds a release to the top of the Releases tab, with the status Queued, Building or Deploying. When its instances pass their health check, its status changes to Live and the release it replaced becomes Replaced. Visitors see no gap: the old release serves until then. If the new release fails, it reads Failed with its build log, and the live release stays live.
What started a release
Section titled What started a releaseThe Started by column of the Releases tab says what started each release:
| It reads | What started it |
|---|---|
Push to <branch> |
A push to a branch of the connected repository. |
Deploy of <ref> |
Deploy a branch…, with the branch, tag or commit you named. |
| Rebuild | Rebuild…. A deployment that runs an image reads Pull again. |
| Redeploy | Redeploy…. |
| Rollback | Roll back to this…. |
| Promotion | Promote to production…. |
| Deploy hook | A call to one of the deployment's deploy hooks (Deploy with a hook). |
| Upload | coritan deploy from a terminal (The Coritan CLI). |
| Image | Deploy an image…, or the order of a deployment that runs an image. |
Under it, the column says who started it, such as you, a member of your organization or the push webhook.
Promote a preview
Section titled Promote a previewA preview that is ready can go to production as it is, without building it again. Open it on the Releases tab and select Promote to production…. Production moves to it once its instances pass their health check, and the preview keeps answering at its own addresses (Turn on previews).
Roll back
Section titled Roll backTo put production back on an earlier release that went live, open it on the Releases tab and select Roll back to this…. We make a new release of that release's build, without building anything: its build output, or its image for a web service that runs one, its files for a static site, and both for a hybrid site. A static site serves those files at once, and the others move production to the new release once its instances are ready. A later push starts a new release as usual, so pause pushes to the production branch if you need production to stay where it is.
A static site keeps each release's files for at least 30 days, so roll it back within those days (Limits). The same works for a site you deploy from a terminal (The Coritan CLI).
Cancel a release
Section titled Cancel a releaseA release that is still queued, building or starting can be stopped with Cancel release…. The live release carries on.
Send part of the traffic to a new release
Section titled Send part of the traffic to a new releaseA canary gives a newer production release a share of the traffic, from 1% to 99%, while the live release takes the rest. Watch its errors on the Metrics tab, then promote it to take all the traffic, or abort it to send everyone back.
- A visitor stays on the release they were given for an hour, so their pages, assets and API calls never mix two releases.
- Nothing is cached at the edge while two releases share an address.
- One canary at a time: promote or abort it before starting another.
To start one, open the deployment's Networking tab and select Start a canary… on the Canary card. The Start a canary page opens. Choose the Release, enter the Share of the traffic from 1 to 99, and select Start canary. To change the share, select Change share… on the same card. The Change the canary share page opens, and Save share takes you back to the tab.
Result
Section titled ResultA release has one of these statuses on the Releases tab:
| Status | Meaning |
|---|---|
| Queued | It waits for a build to start. |
| Building | Its build is running. |
| Deploying | Its instances are starting. |
| Ready | It passed its health check and is not the live release, such as a preview. |
| Live | It is ready and serves production: the live release. |
| Failed | Its build or its instances failed. It keeps its build log, and production stays on the release before it. |
| Cancelled | You cancelled it, or it stopped because a newer release went live or the deployment was suspended. |
| Replaced | It was live until a newer release went live. Its page says A newer release replaced this one. |
The Overview tab shows the live release on its Live release card.
Troubleshooting
Section titled Troubleshooting- The release failed while building
- Open it and read the Build log. The last lines usually name the command that failed. Fix it and push, or select Deploy a branch… again.
- The release built, but never went live
- Its instances did not pass their health check. Check that the app listens on the port in
PORTand answers the health check path, and read the instances' output under Logs (Logs and metrics). - A variable changed, but the live release still shows the old value
- A change applies with the next release. Select Redeploy… for a variable the running app reads. Select Rebuild… for a variable the build reads, such as one that starts with
NEXT_PUBLIC_: a redeploy runs the old build again. - Builds wait before they start
- A spend limit holds new builds. On older terms, the builds your plan runs at once may all be running, or the month's build minutes may be used up on a deployment set to Stop at the allowance (At a limit).
Too many releases or placement changes for this deployment. Wait a few minutes.- A deployment can start 30 releases or placement changes in 10 minutes.
- Roll back to this… is not offered
- Only an earlier production release that went live can be rolled back to. A preview goes to production with Promote to production… instead.
Only a release that was ready once can be rolled back to- The release never went live, such as one that failed or was cancelled, so there is nothing of it to go back to. Roll back to a release that went live, or select Deploy a branch… and type its commit under Branch, tag or commit to build it again. The dashboard offers Roll back to this… only where it works, so this comes from the API or the CLI.
Related
Section titled Related- Deploy from a git repository builds a release for each push.
- Environments and variables explains which variables a build reads.
- The Coritan CLI lists releases, promotes and rolls back from a terminal.
With the API
Section titled With the APIThe routes are under /api/v1/client/deployments/{uuid} for your own deployment and /api/v1/orgs/{org_slug}/deployments/{uuid} for an organization's. Any member of an organization reads them; owners and admins start and change releases.
To deploy a branch or an image, send POST /releases. It starts a release, with git_ref (a branch, a tag or a commit) or image_ref, or neither for the defaults:
curl -X POST https://api.coritan.com/api/v1/client/deployments/$DEPLOYMENT/releases \
-H "Authorization: Bearer $CORITAN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"git_ref": "main"}'
To rebuild or redeploy, send POST /redeploy. With {"rebuild": true} it rebuilds, and with {"rebuild": false}, or no body, it redeploys:
curl -X POST https://api.coritan.com/api/v1/client/deployments/$DEPLOYMENT/redeploy \
-H "Authorization: Bearer $CORITAN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"rebuild": true}'
Each answers 201 with the new release in release. A deployment with no live release has nothing to redeploy, so POST /redeploy builds or pulls it as a deploy of its branch does.
A release says what started it in trigger: push for a push, manual for a deploy of a branch, a tag, a commit or an image, a redeploy, an upload and a promotion, rebuild for a rebuild, rollback and deploy_hook. Its source says what it runs: git, image, upload, redeploy, rollback or promote. A redeploy has source redeploy and trigger manual.
GET /releases lists releases, newest first, and GET /releases/{release} answers one with its instances. A release built from git or an upload has artifact_size (its build output, in bytes), artifact_sha256 and runtime_image, and its image_ref is null; a release of a container image has image_ref. GET /releases/{release}/log answers the end of its build log. POST /releases/{release}/promote, /rollback and /cancel do what Promote to production…, Roll back to this… and Cancel release… do. In the answers, current_release is the live release and is_current marks it. The API reports a replaced release as superseded.
PUT /canary with {"release": "<uuid>", "traffic_percent": 10} gives that release its share, and without release changes the share of the canary there is. POST /canary/promote and POST /canary/abort end it; send the canary's release with either, so you never act on a canary that changed since you read it.