File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,17 @@ SHELL = bash
33BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
44# Current git commit hash
55GIT_COMMIT_HASH := $(shell git show --no-patch --no-notes --pretty='% h' HEAD)
6+ # Current git tag
7+ GIT_TAG := $(shell git describe --tags --exact-match || "")
8+ ifeq ($(GIT_TAG ) ,)
69VERSION := $(BRANCH ) .$(GIT_COMMIT_HASH )
10+ else
11+ VERSION := $(GIT_TAG )
12+ endif
713ifeq ($(shell git status --porcelain) ,)
814DIRTY :=
915else
16+ VERSION := $(BRANCH ) .$(GIT_COMMIT_HASH )
1017DIRTY := "dev"
1118endif
1219LDFLAGS =--ldflags "-s -X github.com/SwissDataScienceCenter/renku-dev-utils/pkg/version.Version=$(VERSION ) -X github.com/SwissDataScienceCenter/renku-dev-utils/pkg/version.VersionSuffix=$(DIRTY ) "
@@ -19,6 +26,7 @@ vars: ## Show the Makefile vars
1926 @echo SHELL=" '$( SHELL) '"
2027 @echo BRANCH=" '$( BRANCH) '"
2128 @echo GIT_COMMIT_HASH=" '$( GIT_COMMIT_HASH) '"
29+ @echo GIT_TAG=" '$( GIT_TAG) '"
2230 @echo VERSION=" '$( VERSION) '"
2331 @echo DIRTY=" '$( DIRTY) '"
2432
You can’t perform that action at this time.
0 commit comments