From 799f71cf07bbe9d4401cd271283c27ddbfc2f6d6 Mon Sep 17 00:00:00 2001 From: Galo Navarro Date: Thu, 30 Oct 2025 11:30:43 +0100 Subject: [PATCH 1/2] Add build instructions to README.md Signed-off-by: Galo Navarro --- .gitignore | 1 + README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/.gitignore b/.gitignore index f84acc1b0..367b320c7 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 eb2b6ebac..d2886258c 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,60 @@ 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` +- **Build Kubernetes artifacts**: `just kube-build` +- **Generate code/manifests**: `just gen` + ## Description // TODO(user): An in-depth paragraph about your project and overview of use From c93b683801849b1dd657ffbd3549fbafb403d481 Mon Sep 17 00:00:00 2001 From: Galo Navarro Date: Thu, 30 Oct 2025 13:21:45 +0100 Subject: [PATCH 2/2] Extend build instructions for kube-build Signed-off-by: Galo Navarro --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2886258c..6100d0cd6 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,24 @@ source. - **Run tests**: `just test` - **Run linters**: `just lint` -- **Build for multiple platforms**: `just build-multi` -- **Build Kubernetes artifacts**: `just kube-build` +- **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