From 9bf1428b781b93654a2daf388efda321cf0f4d04 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Mon, 10 Oct 2022 08:19:36 -0500 Subject: [PATCH] Re-enable Bazel cache on CI (#142975) * Re-enable Bazel cache on CI * remove exit test (cherry picked from commit 30e482bc8ea89b499811e2a195405a2a70125fa6) --- .buildkite/scripts/common/setup_bazel.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.buildkite/scripts/common/setup_bazel.sh b/.buildkite/scripts/common/setup_bazel.sh index a60543e36c941..503ce2ef06c91 100755 --- a/.buildkite/scripts/common/setup_bazel.sh +++ b/.buildkite/scripts/common/setup_bazel.sh @@ -11,12 +11,18 @@ cat < $KIBANA_DIR/.bazelrc build --build_metadata=ROLE=CI EOF -BAZEL_CACHE_MODE=none +BAZEL_CACHE_MODE=${BAZEL_CACHE_MODE:-gcs} if [[ "$BAZEL_CACHE_MODE" == "gcs" ]]; then echo "[bazel] enabling caching with GCS buckets" BAZEL_REGION="${BUILDKITE_AGENT_GCP_REGION:-us-central1}" + + if ! [[ "$BAZEL_REGION" =~ ^(us-central1|northamerica-northeast2|europe-west2|southamerica-east1|asia-south2)$ ]]; then + echo "unsupported bazel cache region $BAZEL_REGION" + exit 1 + fi + BAZEL_BUCKET="kibana-ci-bazel_$BAZEL_REGION" echo "[bazel] using GCS bucket: $BAZEL_BUCKET"