Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.5] Re-enable Bazel cache on CI (#142975) #142987

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .buildkite/scripts/common/setup_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ 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 "unsupported bazel cache region $BAZEL_REGION"
exit 1
fi

BAZEL_BUCKET="kibana-ci-bazel_$BAZEL_REGION"

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