Skip to content

Commit

Permalink
Fix region parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed May 3, 2022
1 parent d4899ec commit a63ba24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .buildkite/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ source .buildkite/scripts/common/setup_bazel.sh

BAZEL_REGION="us-central1"
if [[ "$(curl -is metadata.google.internal || true)" ]]; then
BAZEL_REGION=$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/zone | rev | cut -c3- | rev)
# projects/1003139005402/zones/us-central1-a -> us-central1-a -> us-central1
BAZEL_REGION=$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/zone | rev | cut -d'/' -f1 | cut -c3- | rev)
fi

BAZEL_BUCKET="kibana-ci-bazel_$BAZEL_REGION"
Expand All @@ -19,6 +20,8 @@ build --google_default_credentials
EOF

echo "--- yarn install and bootstrap"
echo "Using Bazel remote cache bucket: $BAZEL_BUCKET"

if ! yarn kbn bootstrap; then
echo "bootstrap failed, trying again in 15 seconds"
sleep 15
Expand Down

0 comments on commit a63ba24

Please sign in to comment.