From 39a5c29468c3abe930ec3578d5a4d1acfe28e137 Mon Sep 17 00:00:00 2001 From: Ricardo Maraschini Date: Wed, 4 Oct 2023 12:39:30 +0200 Subject: [PATCH] chore: allow build on mac os environment download the right yq binary. --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index bcbf74c4a..d71488f5c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ VERSION ?= $(shell git describe --tags --dirty) +UNAME := $(shell uname) +ARCH := $(shell uname -m) BUILDER_NAME = builder APP_NAME = helmvm ADMIN_CONSOLE_CHART_VERSION = 1.100.1 @@ -13,7 +15,16 @@ LD_FLAGS = -X github.com/replicatedhq/helmvm/pkg/defaults.K0sVersion=$(K0S_VERSI default: helmvm-linux-amd64 output/bin/yq: +ifeq ($(UNAME), Darwin) +ifeq ($(ARCH), arm64) + curl -L -o output/bin/yq https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_darwin_arm64 +else + curl -L -o output/bin/yq https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_darwin_amd64 +endif +endif +ifeq ($(UNAME), Linux) curl -L -o output/bin/yq https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 +endif chmod +x output/bin/yq output/bin/helm: