Skip to content

Commit

Permalink
chore: support tools target for arm64
Browse files Browse the repository at this point in the history
Signed-off-by: Pranshu Srivastava <[email protected]>
  • Loading branch information
rexagod committed Sep 17, 2024
1 parent a52ed9b commit 591e87f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/tools
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
golangci-lint v1.55.2
controller-gen v0.14.0
kustomize v4.5.2
oc v4.8.11
oc v4.16.10
operator-sdk v1.34.1
opm v1.39.0
promq v0.0.1
Expand All @@ -13,4 +13,4 @@ jsonnetfmt v0.20.0
jsonnet-lint v0.20.0
jb v0.5.1
gojsontoyaml v0.1.0
shellcheck 0.10.0
shellcheck v0.10.0
26 changes: 12 additions & 14 deletions Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PROMQ_VERSION = v0.0.1

# NOTE: oc is NOT downloadable using the OC_VERSION in its URL, so this has to be manually updated
OC = $(TOOLS_DIR)/oc
OC_VERSION = v4.8.11
OC_VERSION = 4.16.10

CRDOC = $(TOOLS_DIR)/crdoc
CRDOC_VERSION = v0.5.2
Expand Down Expand Up @@ -125,12 +125,11 @@ $(OC) oc: $(TOOLS_DIR)
set -ex ;\
[[ -f $(OC) ]] && exit 0 ;\
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
curl -sSLo $(OC) https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/oc/latest/$${OS}/oc.tar.gz ;\
tar -xf $(TOOLS_DIR)/oc -C $(TOOLS_DIR) ;\
rm -f $(TOOLS_DIR)/README.md ;\
$(OC) version ;\
version=$(OC_VERSION) ;\
$(OC) version | grep -q $${version##v} ;\
if [[ $${OS} == "darwin" ]]; then OS="mac"; fi ;\
curl -sSLo $(OC).tar.gz https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/ocp/stable-4.16/openshift-client-$${OS}-$(OC_VERSION).tar.gz ;\
tar -xf $(OC).tar.gz -C $(TOOLS_DIR) ;\
rm -f $(OC).tar.gz ;\
rm -f $(TOOLS_DIR)/-.md ;\
}

.PHONY: crdoc
Expand Down Expand Up @@ -189,11 +188,10 @@ $(SHELLCHECK) shellcheck: $(TOOLS_DIR)
[[ -f $(SHELLCHECK) ]] && exit 0 ;\
cd $$(mktemp -d) ;\
OS=$(shell go env GOOS) && ARCH=$(shell uname -m) && \
curl -sSLo shellcheck-stable.tar.xz https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.$${OS}.$${ARCH}.tar.xz ;\
tar -xJf shellcheck-stable.tar.xz ;\
cp shellcheck-stable/shellcheck $(SHELLCHECK) ;\
version=$(SHELLCHECK_VERSION) ;\
$(SHELLCHECK) -V | grep -q $${version##v} ;\
if [[ "$$OS" == "darwin" && "$$ARCH" == "arm64" ]]; then shellcheck_arch="aarch64"; fi ;\
curl -sSLo shellcheck.tar.xz https://github.com/koalaman/shellcheck/releases/download/v$(SHELLCHECK_VERSION)/shellcheck-v$(SHELLCHECK_VERSION).$${OS}.$${shellcheck_arch}.tar.xz ;\
tar -xJf shellcheck.tar.xz ;\
cp shellcheck-v$(SHELLCHECK_VERSION)/shellcheck $(SHELLCHECK) ;\
}

.PHONY: jsonnet-tools
Expand All @@ -219,7 +217,7 @@ tools: $(CONTROLLER_GEN) \
echo $$(basename $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) >> $$tools_file ;\
echo $$(basename $(CONTROLLER_GEN)) $(CONTROLLER_GEN_VERSION) >> $$tools_file ;\
echo $$(basename $(KUSTOMIZE)) $(KUSTOMIZE_VERSION) >> $$tools_file ;\
echo $$(basename $(OC)) $(OC_VERSION) >> $$tools_file ;\
echo $$(basename $(OC)) v$(OC_VERSION) >> $$tools_file ;\
echo $$(basename $(OPERATOR_SDK)) $(OPERATOR_SDK_VERSION) >> $$tools_file ;\
echo $$(basename $(OPM)) $(OPM_VERSION) >> $$tools_file ;\
echo $$(basename $(PROMQ)) $(PROMQ_VERSION) >> $$tools_file ;\
Expand All @@ -229,7 +227,7 @@ tools: $(CONTROLLER_GEN) \
echo $$(basename $(JSONNET_LINT)) $(JSONNET_VERSION) >> $$tools_file ;\
echo $$(basename $(JB)) $(JB_VERSION) >> $$tools_file ;\
echo $$(basename $(GOJSONTOYAML)) $(GOJSONTOYAML_VERSION) >> $$tools_file ;\
echo $$(basename $(SHELLCHECK)) $(SHELLCHECK_VERSION) >> $$tools_file ;\
echo $$(basename $(SHELLCHECK)) v$(SHELLCHECK_VERSION) >> $$tools_file ;\
}

.PHONY: clean-tools
Expand Down

0 comments on commit 591e87f

Please sign in to comment.