From f2fa66f6ab5e22463004a1f0bd3afc9e2165f0a0 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Wed, 11 Sep 2024 06:05:06 -0700 Subject: [PATCH] f --- .github/workflows/dependencies.yaml | 2 +- Makefile | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dependencies.yaml b/.github/workflows/dependencies.yaml index 23aa9998e8..db2e88511d 100644 --- a/.github/workflows/dependencies.yaml +++ b/.github/workflows/dependencies.yaml @@ -23,7 +23,7 @@ jobs: - name: K0s run: | # Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed. - export CURVERSION=$(awk '/^K0S_VERSION/{split($3,a,"-"); print a[1]}' Makefile) + export CURVERSION=$(make print-K0S_VERSION) export VERSION=`curl https://api.github.com/repos/k0sproject/k0s/releases/latest | jq -r .name` if [ "$CURVERSION" != "$VERSION" ]; then sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile diff --git a/Makefile b/Makefile index 59c174d080..d3ea40de6b 100644 --- a/Makefile +++ b/Makefile @@ -114,18 +114,29 @@ endif .PHONY: pkg/goods/internal/bins/kubectl-kots pkg/goods/internal/bins/kubectl-kots: - $(MAKE) output/bins/kubectl-kots-$(KOTS_VERSION)-$(ARCH) mkdir -p pkg/goods/internal/bins - cp output/bins/kubectl-kots-$(KOTS_VERSION)-$(ARCH) $@ + if [ "$(KOTS_BINARY_URL_OVERRIDE)" != "" ]; then \ + $(MAKE) output/bins/kubectl-kots-override ; \ + cp output/bins/kubectl-kots-override $@ ; \ + else \ + $(MAKE) output/bins/kubectl-kots-$(KOTS_VERSION)-$(ARCH) ; \ + cp output/bins/kubectl-kots-$(KOTS_VERSION)-$(ARCH) $@ ; \ + fi + touch $@ output/bins/kubectl-kots-%: mkdir -p output/bins mkdir -p output/tmp - if [ "$(KOTS_BINARY_URL_OVERRIDE)" != "" ]; then \ - curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz "$(KOTS_BINARY_URL_OVERRIDE)" ; \ - else \ - curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz "https://github.com/replicatedhq/kots/releases/download/$(call split-hyphen,$*,1)/kots_$(OS)_$(call split-hyphen,$*,2).tar.gz" ; \ - fi + curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz "https://github.com/replicatedhq/kots/releases/download/$(call split-hyphen,$*,1)/kots_$(OS)_$(call split-hyphen,$*,2).tar.gz" + tar -xzf output/tmp/kots.tar.gz -C output/tmp + mv output/tmp/kots $@ + touch $@ + +.PHONY: output/bins/kubectl-kots-override +output/bins/kubectl-kots-override: + mkdir -p output/bins + mkdir -p output/tmp + curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz "$(KOTS_BINARY_URL_OVERRIDE)" tar -xzf output/tmp/kots.tar.gz -C output/tmp mv output/tmp/kots $@ touch $@