19146: Remove unneeded special case checks, explain the needed one.
[arvados.git] / lib / install / arvadostest_docker_run.sh
1 #!/bin/bash
2
3 # Example:
4 #
5 # ./arvadostest_docker_build.sh             # build the base image ("arvadostest")
6 # ./arvadostest_docker_build.sh --update    # update the base image with current version of `arvados-server install`
7 # ./arvadostest_docker_run.sh --interactive # start a container using the previously built base image, copy this source tree into it, and invoke run-tests.sh with the given args
8
9 set -ex -o pipefail
10
11 declare -a qargs
12 for arg in "$@"; do
13     qargs+=("${arg@Q}")
14 done
15
16 SRC=$(realpath $(dirname ${BASH_SOURCE[0]})/../..)
17
18 docker run --rm -it \
19        --privileged \
20        -v /dev/fuse:/dev/fuse \
21        -v ${SRC}:/src/arvados:ro \
22        -v /tmp \
23        --env http_proxy \
24        --env https_proxy \
25        arvadostest \
26        bash -c "
27 set -ex -o pipefail
28 pg_ctlcluster 11 main start
29 cp -a /src/arvados /tmp/
30 cd /tmp/arvados
31 rm -rf tmp config.yml database.yml services/api/config/database.yml
32 mkdir tmp
33 go run ./cmd/arvados-server install -type test
34 build/run-tests.sh WORKSPACE=\$PWD --temp /tmp/arvados/tmp ${qargs[@]}"