Skip to content

DocsBuild and deploy

Deployments

What starts a deployment, what happens in each step, the health check path, what each status means, the deploy hook, and how to cancel, roll back, restart or pause.

A deployment takes one commit of your branch, builds it and puts it online. Each one is kept in the list under Deployments, with its commit, who started it, how long it took and its build log.

A push is built, released and then live

Trigger When
Git push You push to the branch of the app, and Auto deploy on push is on
Manual You choose Deploy at the top of the app. The newest commit of the branch is deployed
Deploy hook Something of yours calls the app’s deploy hook address: a CI pipeline, a CMS that publishes content, a scheduled rebuild. See Deploy hook
Redeploy You choose Restart, or Redeploy now after a change to variables or settings. The current version is put online again with the settings as they are now
Rollback You choose Roll back to this on an earlier deployment
Domain change You add, remove or change a domain. The current version is rolled out again so it answers at the new address

Creating an app deploys nothing. The guide on the app’s page ends with Deploy now, and Deploy at the top of the app starts the first deployment at any time.

  1. Build. The code of that commit is fetched, your packages are installed and your build command runs. A build may take up to 30 minutes. See Build settings.
  2. Deploy commands. If you set any, they run now, once. See Deploy commands.
  3. Release. The new version starts on one replica first. It has 2 minutes to start listening on its port, or, with a health check path, the wait you set to answer on that path. Then the other replicas follow.

If a step fails, the deployment stops and the version that was running stays online. Your visitors do not see a failed deployment.

Without a health check path, a new version takes traffic as soon as its port answers. That is how a new app is set up: the health check is off until you give it a path.

With a path, under Settings, Build & deploy, Health check, the new version takes traffic only once a request to that path answers. A version that listens but cannot do its work, because a database is not reachable or a variable is missing, then never goes live: the deployment fails and the version that was running stays.

  • The path starts with a slash, /health for example, without a hostname or a query, up to 255 characters. Any answer with a status under 400 counts as healthy. The request carries the app’s own hostname, so an app that routes by host answers it like any other request.
  • The wait is how long the new version has to answer on the path, 10 to 300 seconds, 60 unless you change it. It takes the place of the 2 minutes the port check allows. When the path has not answered by then, the deployment fails and the running version stays.
  • Saving does not deploy. The setting is used from the next deployment on. Choose Redeploy now to apply it.

A good path answers only once the app is ready: after it has reached its database, for example. A path that always answers 200 checks no more than the port does. See A health check path for an Express example.

Status Meaning
Queued It waits to start
Building Packages are installed and the build command runs
Deploying The new version is being released
Live This version answers requests now
Superseded It was live until a newer deployment went live
Failed A step failed. The deployment page says which, and why
Cancelled It was stopped before it finished

Auto deploy on push is on for a new app: every push to the branch starts a deployment. Switch it off under Settings, Build & deploy, Source to deploy by hand only. The change applies as soon as you save.

A deploy hook is a secret address that starts a deployment when it is called: from a CI pipeline, from a CMS that publishes content, from a scheduled rebuild. It does what the Deploy button does, under the same rules: the newest commit of the branch is built, and the deploy commands run.

Each app can have one. It is off until you create it under Settings, Build & deploy, Deploy hook. The address is shown once, in a dialog with a copy button, and never again: keep it where your secrets live, never in the repository. Whoever has the address can deploy your app. If you lose it, make a new one.

Call it with POST and no body:

curl -X POST "https://app.arrangic.com/hooks/deploy/..."

It answers 202 with the id of the deployment it started, as {"deployment": "<id>"}. The deployment is listed under Deployments with the trigger “Deploy hook” and no person, and the activity of the team says that the deploy hook started it.

A call while a deployment runs is accepted too. The next deployment waits behind the running one and builds the newest commit of the branch when its turn comes. Calls that arrive while that one still waits answer with its id and start nothing more, so several calls in a row make one deployment, not one each.

When the hook starts nothing, it answers with an error status and a sentence that says why: the address is not the current one, the app is paused, builds are paused for maintenance, or the hook was called too often in a short time. See The deploy hook answers an error.

Make a new address gives the app a new one and the old one stops working at once. Turn off removes the hook and its address stops working at once. The card shows when the hook was created and when it was last called.

Open the deployment and choose Cancel deployment. This works until the release has started. After that, let it finish and roll back if you need to.

Open an earlier deployment under Deployments and choose Roll back to this.

  • It is quick when the build is still kept. The builds of recent deployments are kept and reused. For an older one, the commit is built again first.
  • It uses your settings as they are now. Variables and scaling are the current ones, not those of that day.
  • Deploy commands do not run. A rollback does not undo a database migration. Check that the old code still works with the database as it is.

Restart puts the current version online again on every replica, for an app that hangs or leaks memory. It counts as a deployment and appears in the list.

Pause, under More actions, stops the app and removes its replicas. A paused app does not deploy: pushes are ignored until you choose Resume. Visitors of its platform URL see a page that says the app is paused and asks them to try again later.

Running time is not charged while an app is paused. Custom domains beyond the first one still are.