Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Sep 11, 2024
1 parent 950293d commit f2fa66f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 18 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
Expand Down

0 comments on commit f2fa66f

Please sign in to comment.