diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 5c28afacf444..b2b165b76b61 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -2,11 +2,6 @@ set -euo pipefail -# needed in some systems where retry is not available -if ! declare -f retry > /dev/null; then - source "${BUILDKITE_HOOK_PATH}/../scripts/retry.sh" -fi - # Secrets must be redacted # https://buildkite.com/docs/pipelines/managing-log-output#redacted-environment-variables PRIVATE_CI_GCS_CREDENTIALS_PATH="kv/ci-shared/platform-ingest/gcp-platform-ingest-ci-service-account" diff --git a/.buildkite/scripts/install_macos_tools.sh b/.buildkite/scripts/install_macos_tools.sh index 52c3288e7f1b..a29606a922d8 100755 --- a/.buildkite/scripts/install_macos_tools.sh +++ b/.buildkite/scripts/install_macos_tools.sh @@ -8,7 +8,24 @@ PLATFORM_TYPE_LOWERCASE=$(uname | tr '[:upper:]' '[:lower:]') export BIN=${WORKSPACE:-$PWD}/bin -source ./retry.sh +retry() { + local retries=$1 + shift + local count=0 + until "$@"; do + exit=$? + wait=$((2 ** count)) + count=$((count + 1)) + if [ $count -lt "$retries" ]; then + >&2 echo "Retry $count/$retries exited $exit, retrying in $wait seconds..." + sleep $wait + else + >&2 echo "Retry $count/$retries exited $exit, no more retries left." + return $exit + fi + done + return 0 +} create_workspace() { if [[ ! -d "${BIN}" ]]; then diff --git a/.buildkite/scripts/retry.sh b/.buildkite/scripts/retry.sh deleted file mode 100644 index 413773e079a5..000000000000 --- a/.buildkite/scripts/retry.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -retry() { - local retries=$1 - shift - local count=0 - until "$@"; do - exit=$? - wait=$((2 ** count)) - count=$((count + 1)) - if [ $count -lt "$retries" ]; then - >&2 echo "Retry $count/$retries exited $exit, retrying in $wait seconds..." - sleep $wait - else - >&2 echo "Retry $count/$retries exited $exit, no more retries left." - return $exit - fi - done - return 0 -}