Skip to content

Commit fc47171

Browse files
committed
Add .use_mise to use mise in CI
1 parent 0e425d8 commit fc47171

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

.buildkite/hooks/asdf-pre-command

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
pushd "$(dirname "${BASH_SOURCE[0]}")"/../..
5+
6+
TOOL_VERSION_FILES=()
7+
mapfile -d $'\0' TOOL_VERSION_FILES < <(fd .tool-versions --hidden --absolute-path --print0)
8+
9+
for file in "${TOOL_VERSION_FILES[@]}"; do
10+
echo "Installing asdf dependencies as defined in ${file}:"
11+
parent=$(dirname "${file}")
12+
pushd "${parent}"
13+
14+
asdf install
15+
16+
popd
17+
done
18+
19+
popd

.buildkite/hooks/pre-command

100755100644
Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
#!/usr/bin/env bash
2-
3-
set -eu
4-
pushd "$(dirname "${BASH_SOURCE[0]}")"/../..
5-
6-
TOOL_VERSION_FILES=()
7-
mapfile -d $'\0' TOOL_VERSION_FILES < <(fd .tool-versions --hidden --absolute-path --print0)
8-
9-
for file in "${TOOL_VERSION_FILES[@]}"; do
10-
echo "Installing asdf dependencies as defined in ${file}:"
11-
parent=$(dirname "${file}")
12-
pushd "${parent}"
13-
14-
asdf install
15-
16-
popd
17-
done
18-
19-
popd
2+
# Skip the rest if this is pipeline upload or empty
3+
if [[ "${BUILDKITE_COMMAND:-}" =~ "buildkite-agent pipeline upload".* ]]; then
4+
exit 0
5+
elif [[ "${BUILDKITE_COMMAND:-}" = "" ]]; then
6+
exit 0
7+
fi
8+
9+
if [ ! -f .use_mise ]; then
10+
source ./asdf-pre-command
11+
fi

.use_mise

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Stateless CI agents use the presence of this file to determine whether it should install tools with mise or install them with ASDF.
2+
Thus if you delete this file, CI will use ASDF to install tools and not mise.
3+
4+
The file is only meant to be here while we transition to using mise completely.
5+
6+
For more information you can reach out to the dev-infra team on #discuss-dev-infra.

0 commit comments

Comments
 (0)