Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 21c4bc4

Browse files
author
Matthew Broomfield
committed
Adjust Makefile git tag version logic
* concourse can override the tag * tag uses a very very simple regex
1 parent 54a0983 commit 21c4bc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ TIMESTAMP := $(shell date +%s)
44
# Git
55
# tags are expecetd to be semver versions (example v1.2.3)
66
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
7-
GIT_TAG := $(shell git describe --tags --exact-match `git rev-parse HEAD` 2>/dev/null || echo custom)
7+
GIT_TAG ?= $(shell git describe --tags --exact-match `git rev-parse HEAD` 2>/dev/null || echo custom)
88
COMMIT_HASH := $(shell git rev-parse HEAD)
99

1010
# create a pseudo version based on the timestamp for easy dev releases
11-
VERSION ?= $(shell if [ "custom" = "$(GIT_TAG)" ]; then echo 0.0.$(TIMESTAMP)-custom.$(COMMIT_HASH); else echo $(GIT_TAG) | sed 's/^v//'; fi)
11+
VERSION ?= $(shell if [ "custom" = "$(GIT_TAG)" ]; then echo 0.0.$(TIMESTAMP)-custom.$(COMMIT_HASH); else echo $(GIT_TAG) | egrep -o '[0-9]+\.[0-9]+\.[]0-9]+'; fi)
1212

1313
# BOSH release
1414
RELEASE_TARBALL := stackdriver-tools-release-$(VERSION).tar.gz

0 commit comments

Comments
 (0)