Skip to content

Commit

Permalink
Handle stale kustomize in bin dir. (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: Dean Roehrich <dean.roehrich@hpe.com>
  • Loading branch information
roehrich-hpe committed Jul 6, 2023
1 parent 17c9df6 commit 7f2889f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021, 2022 Hewlett Packard Enterprise Development LP
# Copyright 2021-2023 Hewlett Packard Enterprise Development LP
# Other additional copyright holders may be indicated within.
#
# The entirety of this work is licensed under the Apache License,
Expand Down Expand Up @@ -90,6 +90,9 @@ helm-version: .version ## Updates the Helm values.yaml with new version
clean:
rm -f .version

.PHONY: clean-bin
clean-bin:
rm -rf $(LOCALBIN)

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
Expand All @@ -104,6 +107,8 @@ KUSTOMIZE_VERSION ?= v4.5.7

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
kustomize: $(LOCALBIN) ## Download kustomize locally if necessary.
if [[ ! -s $(LOCALBIN)/kustomize || $$($(LOCALBIN)/kustomize version | awk '{print $$1}' | awk -F/ '{print $$2}') != $(KUSTOMIZE_VERSION) ]]; then \
rm -f $(LOCALBIN)/kustomize && \
{ curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }; \
fi

0 comments on commit 7f2889f

Please sign in to comment.