From 3e2b8556da554407afb69345cae97683fab24fd3 Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Thu, 22 May 2025 13:33:13 +0000 Subject: [PATCH] Add .use_mise to use mise in CI --- .buildkite/hooks/asdf-pre-command | 9 +++++++++ .buildkite/hooks/pre-command | 16 +++++++++------- .use_mise | 6 ++++++ 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100755 .buildkite/hooks/asdf-pre-command mode change 100755 => 100644 .buildkite/hooks/pre-command create mode 100644 .use_mise diff --git a/.buildkite/hooks/asdf-pre-command b/.buildkite/hooks/asdf-pre-command new file mode 100755 index 00000000..7b1701cc --- /dev/null +++ b/.buildkite/hooks/asdf-pre-command @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -eu +pushd "$(dirname "${BASH_SOURCE[0]}")"/../.. + +WORKDIR=$(pwd) + +echo "Installing asdf dependencies as defined in '${WORKDIR}/.tool-versions':" +asdf install diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command old mode 100755 new mode 100644 index 7b1701cc..1a52196e --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -1,9 +1,11 @@ #!/usr/bin/env bash +# 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 -set -eu -pushd "$(dirname "${BASH_SOURCE[0]}")"/../.. - -WORKDIR=$(pwd) - -echo "Installing asdf dependencies as defined in '${WORKDIR}/.tool-versions':" -asdf install +if [ ! -f .use_mise ]; then + source ./asdf-pre-command +fi diff --git a/.use_mise b/.use_mise new file mode 100644 index 00000000..5c2719a0 --- /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.