Skip to content

Commit

Permalink
Re-enable Bazel cache on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Oct 10, 2022
1 parent b3cfd97 commit e9d9ee0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .buildkite/scripts/common/setup_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ cat <<EOF > $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 "supported region $BAZEL_REGION"
exit 1
else
echo "unsupported Bazel cache region"
exit 1
fi
BAZEL_BUCKET="kibana-ci-bazel_$BAZEL_REGION"

echo "[bazel] using GCS bucket: $BAZEL_BUCKET"
Expand Down

0 comments on commit e9d9ee0

Please sign in to comment.