diff --git a/.buildkite/hooks/asdf-pre-command b/.buildkite/hooks/asdf-pre-command new file mode 100644 index 0000000..e8a3da6 --- /dev/null +++ b/.buildkite/hooks/asdf-pre-command @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -eu +pushd "$(dirname "${BASH_SOURCE[0]}")"/../.. + +TOOL_VERSION_FILES=() +mapfile -d $'\0' TOOL_VERSION_FILES < <(fd .tool-versions --hidden --absolute-path --print0) + +for file in "${TOOL_VERSION_FILES[@]}"; do + echo "Installing asdf dependencies as defined in ${file}:" + parent=$(dirname "${file}") + pushd "${parent}" + + asdf install + + popd +done + +popd diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index e8a3da6..1a52196 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -1,19 +1,11 @@ #!/usr/bin/env bash - -set -eu -pushd "$(dirname "${BASH_SOURCE[0]}")"/../.. - -TOOL_VERSION_FILES=() -mapfile -d $'\0' TOOL_VERSION_FILES < <(fd .tool-versions --hidden --absolute-path --print0) - -for file in "${TOOL_VERSION_FILES[@]}"; do - echo "Installing asdf dependencies as defined in ${file}:" - parent=$(dirname "${file}") - pushd "${parent}" - - asdf install - - popd -done - -popd +# Skip the rest if this is pipeline upload or empty +if [[ "${BUILDKITE_COMMAND:-}" =~ "buildkite-agent pipeline upload".* ]]; then + exit 0 +elif [[ "${BUILDKITE_COMMAND:-}" = "" ]]; then + exit 0 +fi + +if [ ! -f .use_mise ]; then + source ./asdf-pre-command +fi diff --git a/.use_mise b/.use_mise new file mode 100644 index 0000000..5c2719a --- /dev/null +++ b/.use_mise @@ -0,0 +1,6 @@ +Stateless CI agents use the presence of this file to determine whether it should install tools with mise or install them with ASDF. +Thus if you delete this file, CI will use ASDF to install tools and not mise. + +The file is only meant to be here while we transition to using mise completely. + +For more information you can reach out to the dev-infra team on #discuss-dev-infra.