diff --git a/.buildkite/pipeline.test-with-integrations-repo.yml b/.buildkite/pipeline.test-with-integrations-repo.yml index 62b0a86ca..313aa9fff 100644 --- a/.buildkite/pipeline.test-with-integrations-repo.yml +++ b/.buildkite/pipeline.test-with-integrations-repo.yml @@ -2,7 +2,7 @@ env: SETUP_GVM_VERSION: 'v0.5.1' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151 LINUX_AGENT_IMAGE: "golang:${GO_VERSION}" GH_CLI_VERSION: "2.29.0" - JQ_VERSION: "1.6" + JQ_VERSION: "1.7" steps: - label: ":go: Run check-static" diff --git a/.buildkite/scripts/install_deps.sh b/.buildkite/scripts/install_deps.sh index a5b311619..0c10ceacb 100755 --- a/.buildkite/scripts/install_deps.sh +++ b/.buildkite/scripts/install_deps.sh @@ -4,6 +4,27 @@ source .buildkite/scripts/tooling.sh set -euo pipefail +platform_type="$(uname)" +hw_type="$(uname -m)" +platform_type_lowercase="${platform_type,,}" + +check_platform_architecture() { + case "${hw_type}" in + "x86_64") + arch_type="amd64" + ;; + "aarch64") + arch_type="arm64" + ;; + "arm64") + arch_type="arm64" + ;; + *) + echo "The current platform/OS type is unsupported yet" + ;; + esac +} + create_bin_folder() { mkdir -p "${WORKSPACE}/bin" } @@ -15,12 +36,14 @@ add_bin_path(){ with_kubernetes() { create_bin_folder - retry 5 curl -sSLo "${WORKSPACE}/bin/kind" "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64" + check_platform_architecture + + retry 5 curl -sSLo "${WORKSPACE}/bin/kind" "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-${platform_type_lowercase}-${arch_type}" chmod +x "${WORKSPACE}/bin/kind" kind version which kind - retry 5 curl -sSLo "${WORKSPACE}/bin/kubectl" "https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" + retry 5 curl -sSLo "${WORKSPACE}/bin/kubectl" "https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/${platform_type_lowercase}/${arch_type}/kubectl" chmod +x "${WORKSPACE}/bin/kubectl" kubectl version --client which kubectl @@ -28,7 +51,11 @@ with_kubernetes() { with_go() { create_bin_folder - retry 5 curl -sL -o "${WORKSPACE}/bin/gvm" "https://github.com/andrewkroh/gvm/releases/download/${SETUP_GVM_VERSION}/gvm-linux-amd64" + check_platform_architecture + + echo "GVM ${SETUP_GVM_VERSION} (platform ${platform_type_lowercase} arch ${arch_type}" + retry 5 curl -sL -o "${WORKSPACE}/bin/gvm" "https://github.com/andrewkroh/gvm/releases/download/${SETUP_GVM_VERSION}/gvm-${platform_type_lowercase}-${arch_type}" + chmod +x "${WORKSPACE}/bin/gvm" eval "$(gvm "$(cat .go-version)")" go version @@ -39,9 +66,11 @@ with_go() { with_github_cli() { create_bin_folder + check_platform_architecture + mkdir -p "${WORKSPACE}/tmp" - local gh_filename="gh_${GH_CLI_VERSION}_linux_amd64" + local gh_filename="gh_${GH_CLI_VERSION}_${platform_type_lowercase}_${arch_type}" local gh_tar_file="${gh_filename}.tar.gz" local gh_tar_full_path="${WORKSPACE}/tmp/${gh_tar_file}" @@ -58,7 +87,11 @@ with_github_cli() { with_jq() { create_bin_folder - retry 5 curl -sL -o "${WORKSPACE}/bin/jq" "https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64" + check_platform_architecture + # filename for versions <=1.6 is jq-linux64 + local binary="jq-${platform_type_lowercase}-${arch_type}" + + retry 5 curl -sL -o "${WORKSPACE}/bin/jq" "https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/${binary}" chmod +x "${WORKSPACE}/bin/jq" jq --version