File tree Expand file tree Collapse file tree 2 files changed +24
-20
lines changed
Expand file tree Collapse file tree 2 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,34 @@ all: build lint test
22
33.PHONY : all
44
5- # Version flags to embed in the binaries
5+ # ################################################
6+ # Determine the type of `push` and `version`
7+ # ################################################
8+
9+ # If TRAVIS_TAG is set then we know this ref has been tagged.
10+ ifdef TRAVIS_TAG
11+ VERSION := $(TRAVIS_TAG )
12+ NOT_RC := $(shell echo $(VERSION ) | grep -v -e -rc)
13+ ifeq ($(NOT_RC),)
14+ PUSHTYPE := release-candidate
15+ else
16+ PUSHTYPE := release
17+ endif
18+ else
619VERSION ?= $(shell [ -d .git ] && git describe --tags --always --dirty="-dev")
720# If we are not in an active git dir then try reading the version from .VERSION.
821# .VERSION contains a slug populated by `git archive`.
922VERSION := $(or $(VERSION ) ,$(shell ./.version.sh .VERSION) )
23+ PUSHTYPE := master
24+ endif
25+
26+ VERSION := $(shell echo $(VERSION ) | sed 's/^v//')
27+
28+ ifdef V
29+ $(info TRAVIS_TAG is $(TRAVIS_TAG))
30+ $(info VERSION is $(VERSION))
31+ $(info PUSHTYPE is $(PUSHTYPE))
32+ endif
1033
1134include make/common.mk
1235include make/docker.mk
Original file line number Diff line number Diff line change @@ -20,25 +20,6 @@ bootstra%:
2020
2121.PHONY : bootstra%
2222
23- # ################################################
24- # Determine the type of `push` and `version`
25- # ################################################
26-
27- # If TRAVIS_TAG is set then we know this ref has been tagged.
28- ifdef TRAVIS_TAG
29- VERSION := $(TRAVIS_TAG)
30- NOT_RC := $(shell echo $(VERSION) | grep -v -e -rc)
31- ifeq ($(NOT_RC),)
32- PUSHTYPE=release-candidate
33- else
34- PUSHTYPE=release
35- endif
36- else
37- VERSION ?= $(shell [ -d .git ] && git describe --tags --always --dirty="-dev")
38- VERSION := $(shell echo $(VERSION) | sed 's/^v//')
39- PUSHTYPE=master
40- endif
41-
4223# ########################################
4324# Build
4425# ########################################
You can’t perform that action at this time.
0 commit comments