This is a short-term solution to reduce our hit count in Buildkite due to the increase in bootstraps so we can move forward with enabling Buildkite across all PRs.
39 lines
1.2 KiB
Bash
Executable file
39 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
source .buildkite/scripts/common/util.sh
|
|
|
|
KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
|
|
export KIBANA_BUILDBUDDY_CI_API_KEY
|
|
|
|
echo "[bazel] writing .bazelrc"
|
|
cat <<EOF > $KIBANA_DIR/.bazelrc
|
|
# Generated by .buildkite/scripts/common/setup_bazel.sh
|
|
|
|
import %workspace%/.bazelrc.common
|
|
|
|
build --build_metadata=ROLE=CI
|
|
EOF
|
|
|
|
if [[ "${BAZEL_CACHE_MODE:-none}" == read* ]]; then
|
|
echo "[bazel] enabling caching"
|
|
cat <<EOF >> $KIBANA_DIR/.bazelrc
|
|
build --bes_results_url=https://app.buildbuddy.io/invocation/
|
|
build --bes_backend=grpcs://cloud.buildbuddy.io
|
|
build --remote_cache=grpcs://cloud.buildbuddy.io
|
|
build --remote_timeout=3600
|
|
build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY
|
|
EOF
|
|
fi
|
|
|
|
if [[ "${BAZEL_CACHE_MODE:-none}" == "read" ]]; then
|
|
echo "[bazel] cache set to read-only"
|
|
cat <<EOF >> $KIBANA_DIR/.bazelrc
|
|
build --noremote_upload_local_results
|
|
EOF
|
|
fi
|
|
|
|
if [[ "${BAZEL_CACHE_MODE:-none}" != @(read|read-write|none|) ]]; then
|
|
echo "invalid value for BAZEL_CACHE_MODE received ($BAZEL_CACHE_MODE), expected one of [read,read-write,none]"
|
|
exit 1
|
|
fi
|