main: Add a --version flag to show the build version
This embeds the version at build time and displays it when passed the --version flag.
This commit is contained in:
parent
63bb56e12d
commit
2cfe043f5e
3 changed files with 6 additions and 3 deletions
2
Makefile
2
Makefile
|
|
@ -98,7 +98,7 @@ $(BUILDDIR)/%/:
|
|||
|
||||
.PHONY: build
|
||||
build: $(BUILDDIR)/bin/ ## build the binary from source
|
||||
go build -o $<image-builder ./cmd/image-builder/
|
||||
go build -ldflags="-X main.BuildVersion=${VERSION}" -o $<image-builder ./cmd/image-builder/
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Remove all built binaries
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue