forked from TrueCloudLab/certificates
Fix version and travis_tag vars in build pipeline
This commit is contained in:
parent
4b8e2f5948
commit
9679299a89
1 changed files with 18 additions and 12 deletions
30
Makefile
30
Makefile
|
@ -28,23 +28,29 @@ bootstra%:
|
||||||
# Determine the type of `push` and `version`
|
# Determine the type of `push` and `version`
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
# Version flags to embed in the binaries
|
# If TRAVIS_TAG is set then we know this ref has been tagged.
|
||||||
|
ifdef TRAVIS_TAG
|
||||||
|
VERSION := $(TRAVIS_TAG)
|
||||||
|
NOT_RC := $(shell echo $(VERSION) | grep -v -e -rc)
|
||||||
|
ifeq ($(NOT_RC),)
|
||||||
|
PUSHTYPE := release-candidate
|
||||||
|
else
|
||||||
|
PUSHTYPE := release
|
||||||
|
endif
|
||||||
|
else
|
||||||
VERSION ?= $(shell [ -d .git ] && git describe --tags --always --dirty="-dev")
|
VERSION ?= $(shell [ -d .git ] && git describe --tags --always --dirty="-dev")
|
||||||
# If we are not in an active git dir then try reading the version from .VERSION.
|
# If we are not in an active git dir then try reading the version from .VERSION.
|
||||||
# .VERSION contains a slug populated by `git archive`.
|
# .VERSION contains a slug populated by `git archive`.
|
||||||
VERSION := $(or $(VERSION),$(shell ./.version.sh .VERSION))
|
VERSION := $(or $(VERSION),$(shell ./.version.sh .VERSION))
|
||||||
VERSION := $(shell echo $(VERSION) | sed 's/^v//')
|
PUSHTYPE := master
|
||||||
NOT_RC := $(shell echo $(VERSION) | grep -v -e -rc)
|
endif
|
||||||
|
|
||||||
# If TRAVIS_TAG is set then we know this ref has been tagged.
|
VERSION := $(shell echo $(VERSION) | sed 's/^v//')
|
||||||
ifdef TRAVIS_TAG
|
|
||||||
ifeq ($(NOT_RC),)
|
ifdef V
|
||||||
PUSHTYPE=release-candidate
|
$(info TRAVIS_TAG is $(TRAVIS_TAG))
|
||||||
else
|
$(info VERSION is $(VERSION))
|
||||||
PUSHTYPE=release
|
$(info PUSHTYPE is $(PUSHTYPE))
|
||||||
endif
|
|
||||||
else
|
|
||||||
PUSHTYPE=master
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
|
|
Loading…
Add table
Reference in a new issue