[libc++] Add a utility script to run the Docker image used by builders

Several contributors have been asking me how to reproduce the CI
environment locally. This is the last step towards making that work
out-of-the-box. Basically, just run `libcxx/utils/ci/run-buildbot-container`
and you're good to go.

Differential Revision: https://reviews.llvm.org/D97782

GitOrigin-RevId: c5659dd4cc84ec1e46b038c19c62ebb6051bd3c4
diff --git a/utils/ci/run-buildbot-container b/utils/ci/run-buildbot-container
new file mode 100755
index 0000000..30e8b18
--- /dev/null
+++ b/utils/ci/run-buildbot-container
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+# This script starts a shell in a container running the libc++ build bot Docker
+# image. That image emulates the environment used by libc++'s Linux builders on
+# BuildKite.
+#
+# Once you're inside the shell, you can run the various build jobs with the
+# `run-buildbot` script.
+#
+# This script must be run from within the LLVM monorepo. Furthermore, the
+# monorepo will be mounted as `/llvm` inside the container. Be careful, the
+# state in `/llvm` is shared between the container and the host machine, which
+# is useful for editing files on the host machine and re-running the build bot
+# in the container.
+
+set -e
+
+MONOREPO_ROOT="$(git rev-parse --show-toplevel)"
+if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci" ]]; then
+    echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
+    exit 1
+fi
+docker pull ldionne/libcxx-builder
+docker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" ldionne/libcxx-builder bash