From 52e531625c260ee13fd7d40cf48471659614a33d Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 15 Jan 2018 11:01:47 -0500 Subject: [PATCH] Use first parent commit when determining version from tags We were having issues where an older tag was being outputed from `git describe`. From the man page: Follow only the first parent commit upon seeing a merge commit. This is useful when you wish to not match tags on branches merged in the history of the target commit. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index aa8b304982..6590c9ab04 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,10 @@ MANAGEMENT_COMMAND ?= awx-manage IMAGE_REPOSITORY_AUTH ?= IMAGE_REPOSITORY_BASE ?= https://gcr.io -VERSION=$(shell git describe --long) -VERSION3=$(shell git describe --long | sed 's/\-g.*//') -VERSION3DOT=$(shell git describe --long | sed 's/\-g.*//' | sed 's/\-/\./') -RELEASE_VERSION=$(shell git describe --long | sed 's@\([0-9.]\{1,\}\).*@\1@') +VERSION=$(shell git describe --long --first-parent) +VERSION3=$(shell git describe --long --first-parent | sed 's/\-g.*//') +VERSION3DOT=$(shell git describe --long --first-parent | sed 's/\-g.*//' | sed 's/\-/\./') +RELEASE_VERSION=$(shell git describe --long --first-parent | sed 's@\([0-9.]\{1,\}\).*@\1@') # NOTE: This defaults the container image version to the branch that's active COMPOSE_TAG ?= $(GIT_BRANCH)