diff --git a/Makefile b/Makefile index f4b0fa6b2..99d78b544 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ BIN_PATH = $(BIN_DIR)/$(ARCH)/$(BIN_NAME) CGO = 0 GIT_COMMIT = $(shell git rev-parse HEAD) -VERSION = $(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD | sed 's/master/latest/' ) +VERSION ?= $(shell hack/tag_name.sh) SOURCES := $(shell find . -type f -name "*.go") BUILD_DATE = $(shell date '+%Y-%m-%d-%H:%M:%S') KUBE_BURNER_VERSION= github.com/cloud-bulldozer/kube-burner/pkg/version diff --git a/hack/tag_name.sh b/hack/tag_name.sh new file mode 100755 index 000000000..acbe753c9 --- /dev/null +++ b/hack/tag_name.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if [[ -z $(git branch --show-current) ]]; then + git describe --tags +else + git branch --show-current +fi