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 <supakeen@redhat.com>
This commit is contained in:
Simon de Vlieger 2025-06-23 08:36:41 +02:00
parent f52041ab67
commit 3021afb9f7
3 changed files with 71 additions and 5 deletions

View file

@ -98,7 +98,7 @@ $(BUILDDIR)/%/:
.PHONY: build
build: $(BUILDDIR)/bin/ ## build the binary from source
go build -ldflags="-X main.BuildVersion=${VERSION}" -o $<image-builder ./cmd/image-builder/
go build -ldflags="-X main.version=${VERSION}" -o $<image-builder ./cmd/image-builder/
.PHONY: clean
clean: ## Remove all built binaries