diff --git a/Makefile b/Makefile index 5e15555..8500e6d 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ export GO15VENDOREXPERIMENT PREFIX ?= $(DESTDIR)/usr BINDIR ?= $(DESTDIR)/usr/bin +COMMIT=$(shell git rev-parse HEAD 2> /dev/null || true) +EPOCH_TEST_COMMIT ?= $(shell git tag | tail -1) default: all @@ -27,7 +29,7 @@ check-license: .PHONY: tool tool: - go build -o oci-image-tool ./cmd/oci-image-tool + go build -ldflags "-X main.gitCommit=${COMMIT}" -o oci-image-tool ./cmd/oci-image-tool all: tool man