buildwarden

Developing BuildWarden

Prerequisites

Commands

make build     # Compile warden binary
make test      # Run unit tests
make cover     # Tests with coverage report
make lint      # Run golangci-lint
make fmt       # Format code
make tidy      # go mod tidy
make clean     # Remove built binaries

Project Structure

cmd/warden/              Host binary — CLI, orchestrator, inspect, extensions
cmd/relay/               Container binary — proxy, ledger writer, DNS, TLS, fair scheduler
ledger/                  Shared library — wire format types, reader, verification
examples/                Example Dockerfiles
docs/design/             Specifications and design documents

Key boundaries

Extension System

Extensions implement BeforeBuild(env *CtrEnv) error and optionally Env() map[string]string. They:

  1. Write files to .warden/ (which gets COPY’d into the build image)
  2. Write shell scripts to .warden/ext.d/ (exec’d inside the build container)
  3. Return env vars to inject into the Dockerfile after each FROM line

Current extensions:

Running Integration Tests

Integration tests require a working container runtime:

warden build examples/Dockerfile.simple

Verify the output:

warden inspect /tmp/warden-ledger-*/ledger

Cutting a Release

  1. Ensure all tests pass: make test
  2. Tag the commit: git tag v0.x.y
  3. Push the tag: git push origin v0.x.y
  4. GoReleaser (via GitHub Actions) builds and publishes binaries