From 5b6c26da805ffbdef10268f74229757681009fc5 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Thu, 9 Jul 2026 08:11:00 -0500 Subject: [PATCH] Makefile binary versions can be more dynamic --- .makefile/helm.mk | 5 +++-- .makefile/kind.mk | 3 +++ .makefile/kluctl.mk | 5 +++-- Makefile | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.makefile/helm.mk b/.makefile/helm.mk index c19b444..fac2b63 100644 --- a/.makefile/helm.mk +++ b/.makefile/helm.mk @@ -1,8 +1,9 @@ ${MY_BINDIR}/helm: | test-jq-is-working @mkdir -p ${MY_BINDIR} @echo "" - @echo -e "Finding latest version of \033[1mhelm\033[0m..." - $(eval HELM_VERSION=$(shell curl -Lfs https://api.github.com/repos/helm/helm/releases/latest | jq '.tag_name' | tr -d '"')) + @if [ "${HELM_VERSION}" = "latest" ]; then \ + HELM_VERSION=$$(curl -Lfs https://api.github.com/repos/helm/helm/releases/latest | jq '.tag_name' | tr -d '"'); \ + fi @echo -e "Downloading \033[1mhelm\033[0m ${HELM_VERSION} for ${OS} ${PLATFORM}..." @echo " https://get.helm.sh/helm-${HELM_VERSION}-${OS}-${PLATFORM}.tar.gz" @curl -Lf https://get.helm.sh/helm-${HELM_VERSION}-${OS}-${PLATFORM}.tar.gz -o ${MY_BINDIR}/helm-${HELM_VERSION}.tar.gz diff --git a/.makefile/kind.mk b/.makefile/kind.mk index 3b75dca..c9b6b26 100644 --- a/.makefile/kind.mk +++ b/.makefile/kind.mk @@ -1,5 +1,8 @@ ${MY_BINDIR}/kind-${KIND_VERSION}: @mkdir -p ${MY_BINDIR} + @if [ "${KIND_VERSION}" = "latest" ]; then \ + KIND_VERSION=$$(curl -Lfs https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq '.tag_name' | tr -d '"'); \ + fi @echo "Downloading kind ${KIND_VERSION} for ${OS} ${PLATFORM}..." @echo " https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-${OS}-${PLATFORM}" @curl -Lfs https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-${OS}-${PLATFORM} -o ${MY_BINDIR}/kind-${KIND_VERSION} diff --git a/.makefile/kluctl.mk b/.makefile/kluctl.mk index 6e90af4..75814a2 100644 --- a/.makefile/kluctl.mk +++ b/.makefile/kluctl.mk @@ -1,8 +1,9 @@ ${MY_BINDIR}/kluctl: | test-jq-is-working @mkdir -p ${MY_BINDIR} @echo "" - @echo -e "Finding latest version of \033[1mkluctl\033[0m..." - $(eval KLUCTL_VERSION=$(shell curl -Lfs https://api.github.com/repos/kluctl/kluctl/releases/latest | jq '.tag_name' | tr -d '"')) + @if [ "${KLUCTL_VERSION}" = "latest" ]; then \ + KLUCTL_VERSION=$$(curl -Lfs https://api.github.com/repos/kluctl/kluctl/releases/latest | jq '.tag_name' | tr -d '"'); \ + fi @echo -e "Downloading \033[1mkluctl\033[0m ${KLUCTL_VERSION} for ${OS} ${PLATFORM}..." @echo " https://github.com/kluctl/kluctl/releases/download/${KLUCTL_VERSION}/kluctl_${KLUCTL_VERSION}_${OS}_${PLATFORM}.tar.gz" @curl -Lf https://github.com/kluctl/kluctl/releases/download/${KLUCTL_VERSION}/kluctl_${KLUCTL_VERSION}_${OS}_${PLATFORM}.tar.gz -o ${MY_BINDIR}/kluctl-${KLUCTL_VERSION}.tar.gz diff --git a/Makefile b/Makefile index ee00009..3b756d2 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ KIND_CLUSTER_NAME := pocketdune KUBERNETES_VERSION := v1.36.1 KIND_VERSION := v0.32.0 KIND_NODE_VERSION := docker.io/kindest/node:v1.36.1@sha256:3489c7674813ba5d8b1a9977baea8a6e553784dab7b84759d1014dbd78f7ebd5 + +HELM_VERSION ?= latest +KLUCTL_VERSION ?= v2.27.0 # END FRUSTRATING MANUAL MAINTANCE MAKEFILE_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))