From 5525f3d17741959a78679a0c3c93ac39e1a54643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Thu, 26 Oct 2023 09:16:12 +0200 Subject: [PATCH] chore(make): correct version defaulting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Bähler --- Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c2fd231c8..551da98d4 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,6 @@ # Version GIT_HEAD_COMMIT ?= $(shell git rev-parse --short HEAD) -VERSION ?= $(shell git describe --abbrev=0 --tags --match "v*") -ifndef VERSION -VERSION = $(GIT_HEAD_COMMIT) -endif +VERSION ?= $(or $(shell git describe --abbrev=0 --tags --match "v*" 2>/dev/null),$(GIT_HEAD_COMMIT)) # Defaults REGISTRY ?= ghcr.io @@ -262,7 +259,7 @@ kustomize: ## Download kustomize locally if necessary. KO = $(shell pwd)/bin/ko KO_VERSION = v0.14.1 ko: - $(call go-install-tool,$(KO),github.com/google/ko@v0.14.1) + $(call go-install-tool,$(KO),github.com/google/ko@$(KO_VERSION)) #################### # -- Helpers