Merge branch 'master' into 8724-keep-block-check-script
[arvados.git] / sdk / cwl / test_with_arvbox.sh
index 83ba66b2e8d6aebd565fcf28cb874e0f5ea6ac2e..bee193858410581801ca2308f8b4045f8dea0179 100755 (executable)
@@ -6,17 +6,28 @@ fi
 
 reset_container=1
 leave_running=0
+config=dev
 
 while test -n "$1" ; do
-    arg="$1"; shift
+    arg="$1"
     case "$arg" in
         --no-reset-container)
             reset_container=0
+            shift
             ;;
         --leave-running)
             leave_running=1
+            shift
             ;;
-        *)
+        --config)
+            config=$2
+            shift ; shift
+            ;;
+        -h|--help)
+            echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo]"
+            exit
+            ;;
+        -*)
             break
             ;;
     esac
@@ -28,13 +39,14 @@ fi
 
 if test $reset_container = 1 ; then
     arvbox reset -f
-    arvbox build dev
 fi
 
-arvbox start dev
+arvbox start $config
 
 arvbox pipe <<EOF
-set -e
+set -eu -o pipefail
+
+. /usr/local/lib/arvbox/common.sh
 
 cd /usr/src/arvados/sdk/cwl
 python setup.py sdist
@@ -50,6 +62,9 @@ git pull
 export ARVADOS_API_HOST=localhost:8000
 export ARVADOS_API_HOST_INSECURE=1
 export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados/superuser_token)
+
+arv-keepdocker --pull arvados/jobs
+
 env
 exec ./run_test.sh "$@"
 EOF