0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/evergreen/generate_evergreen_bazelrc.sh
Zack Winter 96fe0b2355 SERVER-88918 Formalize output_user_root Evergreen setup in bazelrc (#20704)
GitOrigin-RevId: 9443e40f3ca6016a3068e69ad46c897aa2483976
2024-04-08 21:11:50 +00:00

36 lines
1.5 KiB
Bash

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
cd src
set -o errexit
set -o verbose
# Use the Evergreen temp directory to avoid filling up the disk.
mkdir -p $TMPDIR
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "win32" ]]; then
abs_path=$(cygpath -w "$TMPDIR" | tr '\\' '/')
echo "startup --output_user_root=${abs_path}/bazel-output-root" > .bazelrc.evergreen
echo "BAZELISK_HOME=${abs_path}/bazelisk_home" >> .bazeliskrc
else
echo "startup --output_user_root=${TMPDIR}/bazel-output-root" > .bazelrc.evergreen
echo "BAZELISK_HOME=${TMPDIR}/bazelisk_home" >> .bazeliskrc
fi
# Setup the EngFlow credentials for Evergreen builds if remote execution is enabled.
source ./evergreen/bazel_RBE_supported.sh
if bazel_rbe_supported; then
uri="https://spruce.mongodb.com/task/${task_id:?}?execution=${execution:?}"
echo "build --tls_client_certificate=./engflow.cert" >> .bazelrc.evergreen
echo "build --tls_client_key=./engflow.key" >> .bazelrc.evergreen
echo "build --bes_keywords=engflow:CiCdPipelineName=${build_variant:?}" >> .bazelrc.evergreen
echo "build --bes_keywords=engflow:CiCdJobName=${task_name:?}" >> .bazelrc.evergreen
echo "build --bes_keywords=engflow:CiCdUri=${uri:?}" >> .bazelrc.evergreen
echo "build --bes_keywords=evg:project=${project:?}" >> .bazelrc.evergreen
echo "build --remote_upload_local_results=True" >> .bazelrc.evergreen
echo "build --workspace_status_command=./evergreen/engflow_workspace_status.sh" >> .bazelrc.evergreen
fi