Skip to main content

Prebuilds

Overview

Prebuilds are a way to automatically build your project, triggered by push events to your repository. They are used as a foundation for creating workspaces.

Prebuilds include:

  • A "buildfs" event that builds an image from a Dockerfile;
  • Prebuild tasks that run in the buildfs image.

You can view current and previous prebuilds in your project's "Prebuilds" tab.

prebuilds-tab

Configuration

Prebuilds are configured in the hocus.yml file at the root of your project.

Statuses

A prebuild can have one of the following statuses:

  • Pending - the prebuild is waiting to be scheduled;
  • Running - prebuild tasks are running;
  • Success - the prebuild was successful;
  • Error - the prebuild failed;
  • Cancelled - the prebuild was cancelled. This can happen if the buildfs event fails.
  • Pending Archive - the prebuild is waiting to be archived;
  • Archived - the prebuild was archived.

Archive

Once a prebuild is archived, its backing files are deleted, freeing up server space. However, it's not completely gone as its task logs can still be accessed. Archiving is triggered automatically when a prebuild is no longer the latest successful one for any Git branches.

Delete

When a prebuild is deleted, it is completely removed from the database. This process occurs automatically when the prebuild meets certain criteria: it must be at least 48 hours old, it must have been archived, and there can be no workspaces based on it.