Skip to main content

App builds and deployments on Cloider

Every deploy of a Cloider app creates a build: a numbered version that downloads your source, builds an image, deploys it and waits until it is running. The Builds tab is the app's deployment history, with each build's status, source, timing and full output. This page explains the build lifecycle, how a new version replaces the old one, how to follow and read build logs, and how to retry or redeploy.

At a glance​

  • Builds are numbered per app: 1, 2, 3 and so on. A retry keeps the number and counts as another attempt.
  • One build runs at a time per app. A deploy, retry or push that arrives during a build is refused or skipped.
  • A new version goes live only once it is running and has stayed up for 15 seconds. Until then the previous version keeps serving, so a broken build never takes a working app down.
  • The whole build is limited to 30 minutes, and the new version must answer on its port within 5 minutes of deploying.
  • Each build keeps the last 64 KB of its output, including the app's own output when it fails to start.
  • Cloider keeps the images of the two most recently deployed versions. There is no rollback to older images.
The Builds tab of the blog app listing versions 3, 2 and 1 with their status, source, start time and duration, version 3 marked live
The Builds tab: every version of the app, newest first.

What starts a build?​

ActionSource of the build
Creating an appThe uploaded folder or the fetched repository
cloider deploy in a linked folder, or Deploy new versionA new upload
A push to the branch of a git app with auto deploy on, Deploy latest commit, or cloider deploy --gitThe newest commit of the branch
Changing the Start command on SettingsThe source the app is serving, built again
Saving Build arguments or Build variablesThe source the app is serving, built again
Retry on a failed buildThat build's own source, built again as a new attempt
Deploy, cloider deploy --app, or the deploy hook of an image appThe image the app's tag points at, nothing is built

Changing the Port doesn't build: it redeploys the image the app is already running with the new port. Saving Environment variables doesn't build either: it restarts the app.

Build statuses​

A build moves through these statuses. The app's own status mirrors the build that is running, so the Apps list shows how far a deploy has got.

StatusMeaning
PendingWaiting for the source: the upload hasn't finished, or the commit is being fetched from git
QueuedThe source is in place and the build is waiting for a builder
BuildingDownloading the source and building the image
DeployingThe image is pushed and being applied to the platform
StartingThe new container is starting. Cloider waits for it to accept connections on the app's port and stay up for 15 seconds
ReadyThis version is running. It is the app's live version, marked live in the list
SupersededThis version was live and a newer one replaced it
FailedThe build, the deploy or the start failed. The message says which. A failed build can be retried
CanceledThe app was deleted while the build waited in the queue

A build that sits in Pending for 15 minutes, or in one of the running statuses for 45 minutes without moving, is marked Failed so it can't block the app's next build.

How does a new version replace the old one?​

Deploys are rolling and safe by default:

  1. While the new version builds, the current one keeps serving.
  2. When the image is ready, Cloider starts a container of the new version next to the old one.
  3. The new container only receives traffic once it accepts connections on the app's port.
  4. Cloider then watches it for 15 seconds. If it stays up, the build is Ready, the previous build becomes Superseded, and the old container is stopped.
  5. If the new container crashes, never opens the port within 5 minutes, or its image can't be pulled, the build is Failed and the app stays Ready on its previous version.

The first version of an app has nothing to fall back to, so when its build fails the app itself is Failed until a build succeeds.

Follow a build and read its logs​

A build's output covers the whole deploy: downloading the source, the docker build or buildpack output, the push, the deploy and the wait for the app to start. It streams live while the build runs, colors included.

  1. Open the app and go to the Builds tab.
  2. Click Logs on a build. The Build output dialog opens; a running build shows Live and follows new lines.
  3. Click the maximize button for a full screen view, and Close when done.
The Build output dialog for version 3 of blog, streaming buildpack output with a Live badge
A build's output, streamed live while it runs.

What is in a failed build's output?​

When a version builds but fails to start, the output ends with a --- app output --- line followed by the last 100 lines your app printed before it stopped. That is usually where the real error is: a missing environment variable, a module that isn't installed, or an exception at startup.

Build output (end)
Deploying the image...
Waiting for the app to start...
The app started and then stopped.
--- app output ---
Error: Cannot find module 'express'
Require stack:
- /workspace/server.js

Retry a failed build​

Retry runs a failed build again on the same source, keeping its version number and adding an attempt (shown as attempt 2). It is the right move for a failure that wasn't caused by your code, such as a registry hiccup or a timeout. To fix your code, deploy a new version instead.

  1. Open the app's Builds tab.
  2. Click Retry on the failed build.

Retry is disabled while another build runs or the app is paused.

Only a Failed build can be retried, and only if its source was uploaded. A build whose upload never finished says This build never received its source, deploy a new version instead!

Redeploy without changing the code​

There is no separate redeploy button; each of these redeploys the app:

  • Restart with new settings: save the Environment tab. The app restarts with the same image.
  • Same image, new port: change the Port on Settings.
  • Rebuild the same source: change the Start command or a build list. The source the app serves is built again as a new version.
  • Rebuild a git app: click Deploy latest commit, even when the branch hasn't moved.
  • Rebuild an upload: run cloider deploy again in the linked folder.
  • Pull an image app's tag again: click Deploy on the Builds tab of an image app. When the tag still points at the running image, nothing is deployed.

Roll back to an earlier version​

Cloider doesn't roll back to an older image. To go back, deploy the old code again as a new version: check out the earlier commit and run cloider deploy, or revert the commit in git and push. Because a failed build never replaces the live version, you rarely need to roll back after a bad deploy: fix the problem and deploy again. An image app rolls back by deploying a tag that still points at the older image.

Verify​

  • The newest build is Ready and marked live on the Builds tab.
  • The app's Overview shows the same Live version.
  • cloider app get blog prints the version and Status Ready.

Troubleshooting​

Build messageWhat it means
Image build failedThe docker build or buildpack build failed. The output says why
Deploy failedThe platform didn't accept the deploy. Retry the build
The app image could not be pulledThe new image couldn't be pulled for 60 seconds. Retry the build
The app started and then stoppedThe container exited or crashed. See the app output at the end of the logs
The app did not start in timeNothing accepted connections on the app's port within 5 minutes. Usually a port mismatch
The app could not be startedThe container couldn't be created, for example an invalid command or entrypoint
The source upload did not finishThe upload was interrupted or never confirmed. Deploy again
The build did not finish in timeThe build made no progress for 45 minutes. Retry it
The app's registry couldn't be prepared, retry the build in a moment.A temporary registry problem. Retry
This app is already building, wait for that build to finish before deploying a new version!One build at a time per app

Troubleshooting apps goes through each failure and its fixes.

Next steps​

Frequently asked questions

Does a Cloider deploy cause downtime?

No. The new version starts next to the old one and only receives traffic once it accepts connections on the app's port and stays up for 15 seconds. If it fails, the previous version keeps serving.

How long can a build take?

The whole build, from downloading the source to pushing the image, is limited to 30 minutes. After the deploy, the new version has 5 minutes to accept connections on its port.

Can I run two builds of the same app at once?

No. An app builds one version at a time, and a deploy, retry or git push that arrives during a build is refused or skipped. Different apps build in parallel.

How do I roll back a Cloider app?

Deploy the earlier code again as a new version, for example by reverting the commit and pushing, or checking out the earlier commit and running cloider deploy. Cloider keeps only the two latest deployed images and has no rollback button.

What is the difference between Retry and deploying again?

Retry rebuilds a failed build's own source under the same version number, as a new attempt. Deploying again uploads or fetches the current source and creates the next version.