diff --git a/.gitignore b/.gitignore index f84acc1b..367b320c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ kubeconfig *.so *.dylib bin/* +hack/bin/ Dockerfile.cross # Test binary, build with `go test -c` diff --git a/README.md b/README.md index eb2b6eba..6100d0cd 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,74 @@ README isn't up-to-date. // TODO(user): Add simple overview of use/purpose +## Building the Project + +This project uses [just](https://github.com/casey/just) as a command +runner (similar to `make`). Follow these steps to build the project from +source. + +### Prerequisites + +- **Go** 1.21 or later +- **just** 1.36.0 or higher command runner - Install with: + ```sh + # On macOS or Linux (recommended for specific version) + cargo install just --version 1.36.0 + + # On macOS (using Homebrew - may install a different version) + brew install just + + # Or download from https://github.com/casey/just/releases + ``` +### Build Steps + +1. **Build all binaries** + + Run the main build command: + ```sh + just build + ``` + + This will: + - Format and vet the Go code + - Generate Kubernetes CRDs and RBAC manifests + - Generate API documentation + - Build all binaries for Linux/amd64: + - `bin/fabric` - Main controller + - `bin/agent` - Agent binary + - `bin/hhfctl` - User-facing CLI tool + - `bin/fabric-boot` - Boot service + - `bin/fabric-dhcpd` - DHCP daemon + +2. **View available commands** + + See all available build targets: + ```sh + just --list + ``` + +### Other Useful Commands + +- **Run tests**: `just test` +- **Run linters**: `just lint` +- **Build for multiple platforms**: `just build-multi` (builds hhfctl for Linux and macOS, both amd64 and arm64) +- **Generate code/manifests**: `just gen` + +### Building Kubernetes Artifacts + +To build Docker images and Helm charts: + +```sh +just kube-build +``` + +Built images: +- `127.0.0.1:30000/githedgehog/fabric/fabric:` +- `127.0.0.1:30000/githedgehog/fabric/fabric-dhcpd:` +- `127.0.0.1:30000/githedgehog/fabric/fabric-boot:` + +Where `` is determined by `git describe --tags --always`. + ## Description // TODO(user): An in-depth paragraph about your project and overview of use