Skip to content

Commit 4798246

Browse files
authored
Merge pull request #107 from sourcegraph/wb/use-mise
Use Mise
2 parents 0e425d8 + a75dd7e commit 4798246

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed

.buildkite/ci-checkov.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# Set this to fail on the install
33
set -euxo pipefail
44

5-
# Install and run the plugin for checkov
6-
# Use the full path to run pip3.10
7-
pip3 install checkov
8-
95
# List of checks we do not want to run here
106
# This is a living list and will see additions and mostly removals over time.
117
SKIP_CHECKS="CKV_GCP_22,CKV_GCP_66,CKV_GCP_13,CKV_GCP_71,CKV_GCP_61,CKV_GCP_21,CKV_GCP_65,CKV_GCP_67,CKV_GCP_20,CKV_GCP_69,CKV_GCP_12,CKV_GCP_24,CKV_GCP_25,CKV_GCP_64,CKV_GCP_68,CKV2_AWS_5,CKV2_GCP_3,CKV2_GCP_5,CKV_AWS_23,CKV_GCP_70,CKV_GCP_62,CKV_GCP_62,CKV_GCP_62,CKV_GCP_62,CKV_GCP_29,CKV_GCP_39"
@@ -19,7 +15,7 @@ echo "==========================================================================
1915
# Set not to fail on non-zero exit code
2016
set +e
2117
# Run checkov
22-
python3 -m checkov.main --skip-check $SKIP_CHECKS --quiet --framework terraform --compact -d .
18+
checkov --skip-check $SKIP_CHECKS --quiet --framework terraform --compact -d .
2319

2420
# Options
2521
# --quiet: Only show failing tests

.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

.tool-versions

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
yarn 1.22.4
22
kubectl 1.17.3
3-
fd 7.4.0
4-
pulumi 3.2.1
5-
python system
3+
fd 7.4.0
4+
pulumi 3.2.1
5+
checkov latest

.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)