#!/bin/bash # # Wraps a test invocation in docker. set -e IMAGE=$1 RUN_REMOTE=$2 LOCAL_MOUNT=$3 DOCKER_ENV=$4 TEST_PATH=$(realpath "$5") shift 5 if [ "${RUN_REMOTE}" == "yes" ]; then echo "Using docker environment from ${DOCKER_ENV}:" cat "${DOCKER_ENV}" fi # shellcheck disable=SC1090 . "${DOCKER_ENV}" CONTAINER_NAME="envoy-test-runner" ENVFILE=$(mktemp -t "bazel-test-env.XXXXXX") function cleanup() { rm -f "${ENVFILE}" if [ "${RUN_REMOTE}" == "yes" ]; then docker rm -f "${CONTAINER_NAME}" || true # We don't really care if it fails. fi } trap cleanup EXIT cat > "${ENVFILE}" <