Skip to content

Commit 2cc67b8

Browse files
committed
Fixing version and tag vars in make.
1 parent 80d074a commit 2cc67b8

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

Makefile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff 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
619
VERSION ?= $(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`.
922
VERSION := $(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

1134
include make/common.mk
1235
include make/docker.mk

make/common.mk

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff 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
#########################################

0 commit comments

Comments
 (0)