properly set GIT_BRANCH when building on gitlab-ci
https://docs.gitlab.com/ce/ci/variables/README.html CI_COMMIT_REF_NAME Signed-off-by: Thomas Bernard <miniupnp@free.fr>
This commit is contained in:
parent
af22ed7333
commit
994b950616
@ -35,7 +35,11 @@
|
|||||||
|
|
||||||
# Detect GIT revision
|
# Detect GIT revision
|
||||||
GIT_REVISION = $(shell git rev-list --count 1af8c74f53110e349d8f0d19b14599281913f71f..)
|
GIT_REVISION = $(shell git rev-list --count 1af8c74f53110e349d8f0d19b14599281913f71f..)
|
||||||
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
|
ifneq (,$(CI_COMMIT_REF_NAME))
|
||||||
|
GIT_BRANCH = $(CI_COMMIT_REF_NAME)
|
||||||
|
else
|
||||||
|
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
endif
|
||||||
ifneq (master,$(GIT_BRANCH))
|
ifneq (master,$(GIT_BRANCH))
|
||||||
GIT_REVISION := "$(GIT_REVISION)-$(GIT_BRANCH)"
|
GIT_REVISION := "$(GIT_REVISION)-$(GIT_BRANCH)"
|
||||||
endif
|
endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user