Overview
Builds represent individual deployment attempts for your project. Each build tracks the commit SHA, build status, timing information, and logs.Build Model
Each build in the system contains:Build Status States
pending
Build is queued or in progress
success
Build completed successfully
failed
Build process failed
Get Project Builds
GET /api/projects/:id/builds
Retrieve build history for a project (up to 50 most recent builds).
string
required
Project ID (MongoDB ObjectId)
Builds are sorted by creation date in descending order (newest first) and limited to 50 results.
Get Single Build
GET /api/projects/:id/builds/:buildId
Retrieve detailed information for a specific build.
string
required
Project ID (MongoDB ObjectId)
string
required
Build ID (MongoDB ObjectId)
The single build endpoint includes the
dockerImage field, which is not included in the list view.Build Indexing
Builds are indexed for efficient querying:- Filter by project ID
- Sort by creation date in descending order
Build Creation Process
When a new deployment is created, the build process:1. Fetch Commit SHA
2. Create Build Record
3. Update Project Reference
4. Queue Build Job
Build Duration Calculation
Build duration is calculated from the difference betweenstartedAt and finishedAt:
- Less than 60 seconds:
"34s" - 60 seconds or more:
"2m 34s"
Total Build Counter
The project maintains atotalBuilds counter:
Example: Monitor Build Progress
Example: Display Build History
Build Queue System
Builds are processed asynchronously through a queue system: Queue Name:buildqueue
Job Data:
/src/workers/buildworker.js
The build worker:
- Fetches build and project details
- Clones the repository
- Builds Docker image
- Updates build status and timing
- Triggers deployment if successful
Error Responses
404 Not Found - Project
404 Not Found - Build
500 Server Error
Build Logs
ThelogUrl field points to the location of build logs:
Build logs are generated during the build worker process and stored separately from the build metadata.