Skip to content

Commit

Permalink
Strip 'mimir-' prefix from git tag when building image tag (#1261)
Browse files Browse the repository at this point in the history
* Strip 'mimir-' prefix from git tag when building image tag

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fix

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Applying Arve fix

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Another fix

Signed-off-by: Marco Pracucci <marco@pracucci.com>
  • Loading branch information
pracucci authored Feb 22, 2022
1 parent 63ac397 commit ee226f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ BUILD_IMAGE ?= $(IMAGE_PREFIX)mimir-build-image
# the tag we are at as the image tag.
ifneq (,$(findstring refs/tags/, $(GITHUB_REF)))
GIT_TAG := $(shell git tag --points-at HEAD)
# If the git tag starts with "mimir-" (eg. "mimir-2.0.0") we strip
# the "mimir-" prefix in order to keep only the version.
IMAGE_TAG_FROM_GIT_TAG := $(patsubst mimir-%,%,$(GIT_TAG))
endif
IMAGE_TAG ?= $(if $(GIT_TAG),$(GIT_TAG),$(shell ./tools/image-tag))
IMAGE_TAG ?= $(if $(IMAGE_TAG_FROM_GIT_TAG),$(IMAGE_TAG_FROM_GIT_TAG),$(shell ./tools/image-tag))
GIT_REVISION := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
UPTODATE := .uptodate
Expand Down

0 comments on commit ee226f8

Please sign in to comment.