xref: /netbsd-src/external/apache2/llvm/dist/libcxx/utils/ci/run-buildbot-container (revision 4d6fc14bc9b0c5bf3e30be318c143ee82cadd108)
1*4d6fc14bSjoerg#!/usr/bin/env bash
2*4d6fc14bSjoerg
3*4d6fc14bSjoerg# This script starts a shell in a container running the libc++ build bot Docker
4*4d6fc14bSjoerg# image. That image emulates the environment used by libc++'s Linux builders on
5*4d6fc14bSjoerg# BuildKite.
6*4d6fc14bSjoerg#
7*4d6fc14bSjoerg# Once you're inside the shell, you can run the various build jobs with the
8*4d6fc14bSjoerg# `run-buildbot` script.
9*4d6fc14bSjoerg#
10*4d6fc14bSjoerg# This script must be run from within the LLVM monorepo. Furthermore, the
11*4d6fc14bSjoerg# monorepo will be mounted as `/llvm` inside the container. Be careful, the
12*4d6fc14bSjoerg# state in `/llvm` is shared between the container and the host machine, which
13*4d6fc14bSjoerg# is useful for editing files on the host machine and re-running the build bot
14*4d6fc14bSjoerg# in the container.
15*4d6fc14bSjoerg
16*4d6fc14bSjoergset -e
17*4d6fc14bSjoerg
18*4d6fc14bSjoergMONOREPO_ROOT="$(git rev-parse --show-toplevel)"
19*4d6fc14bSjoergif [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci" ]]; then
20*4d6fc14bSjoerg    echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
21*4d6fc14bSjoerg    exit 1
22*4d6fc14bSjoergfi
23*4d6fc14bSjoergdocker pull ldionne/libcxx-builder
24*4d6fc14bSjoergdocker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" ldionne/libcxx-builder bash
25