From 3021afb9f756dc60d78efc5f51047e06deac0861 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Mon, 23 Jun 2025 08:36:41 +0200 Subject: [PATCH] main: `--version` includes git commit Include the commit of the build (if available in the build environment), also include the version of `images` in the build; if available. Signed-off-by: Simon de Vlieger --- Makefile | 2 +- cmd/image-builder/main.go | 9 ++--- cmd/image-builder/version.go | 65 ++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 cmd/image-builder/version.go diff --git a/Makefile b/Makefile index 404dc3f..7f1a5d0 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ $(BUILDDIR)/%/: .PHONY: build build: $(BUILDDIR)/bin/ ## build the binary from source - go build -ldflags="-X main.BuildVersion=${VERSION}" -o $