From ee2036cd1001f10c180d897cef6708a327ceeb56 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Jun 18 2019 14:48:15 +0000 Subject: Add option --no-tty to run-unittests.sh This is useful for running run-unittests.sh in Jenkins. When set --no-tty, -i and -t are not added to docker-run command. Signed-off-by: Chenxiong Qi --- diff --git a/contrib/run-unittests.sh b/contrib/run-unittests.sh index 443ef17..8f7f01f 100755 --- a/contrib/run-unittests.sh +++ b/contrib/run-unittests.sh @@ -17,11 +17,13 @@ enable_py3= with_pgsql= +no_tty= for arg in "$@"; do case $arg in --py3) enable_py3=1 ;; --with-pgsql) with_pgsql=1 ;; + --no-tty) no_tty=1 ;; esac done @@ -41,7 +43,11 @@ else test_image="${image_ns}/mbs-test-centos" fi -container_opts=(--rm -i -t -v "${volume_mount}" --name mbs-test) +container_opts=(--rm -v "${volume_mount}" --name mbs-test) + +if [ -z "$no_tty" ]; then + container_opts+=(-i -t) +fi if [ -n "$with_pgsql" ]; then container_opts+=(--link "${db_container_name}":db -e "DATABASE_URI=$pgdb_uri")