Skip to main content
DeployHub provides comprehensive build tracking and monitoring capabilities to help you understand your deployment pipeline and troubleshoot issues.

Build Model

Each build is tracked as a document in the Build collection:
Build Statuses:
  • pending - Build queued or in progress
  • success - Build completed successfully
  • failed - Build encountered an error
Builds are indexed by project and creation time for fast historical queries.

Build Lifecycle

1. Build Creation

A new build is created when deployment starts:

2. Build Queuing

Build is added to BullMQ queue:

3. Build Processing

Build worker picks up the job:

4. Docker Build Logs

Build progress is streamed to stdout:
Example Build Output:

5. Image Push Logs

Image push progress is also streamed:

6. Build Completion

Successful builds update the database:

7. Build Failure

Failed builds are marked accordingly:

Worker Event Logging

Build Worker Events

Deployment Worker Events

Redeployment Worker Events

Retrieving Build History

Get All Builds for Project

API Endpoint:
Response:
Build history is limited to 50 most recent builds per project for performance.

Get Single Build Details

API Endpoint:
Response:

Build Duration Calculation

Calculate build time from timestamps:

Container Logs

For Node.js applications, container logs can be retrieved:
Retrieving logs manually:

Build Statistics

Project model tracks total build count:
Incremented on each build:

Commit SHA Tracking

Each build stores the Git commit SHA:
Commit SHA enables intelligent redeployments - DeployHub checks if code has changed before rebuilding.

Redeployment Intelligence

Redeployment worker checks commit history:
Rebuild triggers:
  • Previous build failed
  • New commit detected (SHA mismatch)
Reuse existing image when:
  • Same commit SHA
  • Previous build succeeded

Error Handling

Build errors are captured and logged:
Errors trigger the worker’s failed event, which:
  1. Updates build status to failed
  2. Updates project status to failed-deploy
  3. Logs error details

Build Cleanup

Build artifacts are cleaned up automatically:
Build directories are removed after processing to conserve disk space.

Monitoring Recommendations

Real-Time Monitoring

Build Status Indicators

Common Build Issues

Build Timeout

Builds may timeout if they take too long:
  • Optimize dependencies (use npm ci instead of npm install)
  • Reduce build output size
  • Check for infinite loops in build scripts

Out of Memory

Large builds may exceed memory limits:
  • Reduce concurrent build processes
  • Optimize webpack/vite configuration
  • Use smaller dependencies

Docker Build Errors

Common Docker issues:
  • Missing Dockerfile
  • Invalid build arguments
  • File permission issues
  • Network connectivity problems

Image Push Failures

Push errors usually indicate:
  • Docker Hub authentication issues
  • Network connectivity problems
  • Insufficient disk space
  • Registry rate limits

API Reference Summary

Get Project Builds

Returns up to 50 most recent builds.

Get Build Details

Returns detailed information for a specific build.

Future Enhancements

Planned Features

  • Real-time WebSocket log streaming
  • Build log storage and retrieval
  • Build metrics and analytics
  • Build performance insights
  • Email notifications on build failure
  • Slack/Discord integration
Currently, logs are written to stdout/stderr. Log persistence to object storage is planned for future releases.