Skip to content

Implement /v1/builds endpoint (Deploy from Git / Nixpacks) #22

@dennisonbertram

Description

@dennisonbertram

Overview

The website advertises a "Deploy from Git" feature using Nixpacks auto-detection, but the /v1/builds API routes are not yet implemented. Currently returns 404.

Endpoints needed

  • POST /v1/builds — Trigger a build from a git URL

    {
      "git_url": "https://github.com/user/repo",
      "ref": "main",
      "service_name": "web"
    }

    Response: {"id": "bld_...", "status": "queued"}

  • GET /v1/builds/{id} — Get build status
    Response: {"id": "bld_...", "status": "building|succeeded|failed", "started_at": "...", "finished_at": "..."}

  • GET /v1/builds/{id}/logs — Stream build logs (SSE or chunked)
    Streams Nixpacks build output line by line

Acceptance criteria

  • Nixpacks detects language/runtime automatically (Node, Python, Go, Ruby, Rust)
  • Build runs in a gVisor sandbox
  • Logs stream in real time via the /logs endpoint
  • On success, the built image is deployed as a service automatically
  • On failure, the previous service version continues running
  • Build history is stored in SQLite
  • All responses are machine-readable JSON (no HTML errors)

Website impact

The homepage "Deploy from Git" feature section is currently marked Coming Soon until this is implemented.

Related

  • Current Traefik routing config: /etc/traefik/dynamic/ah-site.yml
  • API server: ah binary on port 8080
  • Nixpacks binary should be available at /usr/local/bin/nixpacks (verify on server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions