Build a python-jsonschema package, because cwltool requires version 2.4
[arvados-dev.git] / jenkins / run-docker-tests.sh
index 9a3e5668cbc2edabcb67fb468ac4c8a9a60dd0be..0b5148e39d324727b786423b22b40e61962f2e6b 100755 (executable)
@@ -8,8 +8,44 @@ title () {
   printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
 }
 
+docker_push () {
+  # Sometimes docker push fails; retry it a few times if necessary.
+  for i in `seq 1 5`; do
+    $DOCKER push $*
+    ECODE=$?
+    if [[ "$ECODE" == "0" ]]; then
+      break
+    fi
+  done
+
+  if [[ "$ECODE" != "0" ]]; then
+    title "!!!!!! docker push $* failed !!!!!!"
+    EXITCODE=$(($EXITCODE + $ECODE))
+  fi
+}
+
+# Sanity check
+if ! [[ -n "$WORKSPACE" ]]; then
+  echo >&2
+  echo >&2 "Error: WORKSPACE environment variable not set"
+  echo >&2
+  exit 1
+fi
+
 echo $WORKSPACE
 
+# find the docker binary
+DOCKER=`which docker.io`
+
+if [[ "$DOCKER" == "" ]]; then
+  DOCKER=`which docker`
+fi
+
+if [[ "$DOCKER" == "" ]]; then
+  title "Error: you need to have docker installed. Could not find the docker executable."
+  exit 1
+fi
+
 # DOCKER
 title "Starting docker build"
 
@@ -34,6 +70,21 @@ fi
 
 title "docker build complete"
 
+title "uploading images"
+
+if [[ "$ECODE" == "0" ]]; then
+  docker_push arvados/api
+  docker_push arvados/compute
+  docker_push arvados/doc
+  docker_push arvados/workbench
+  docker_push arvados/keep
+  docker_push arvados/shell
+else
+  title "upload arvados images SKIPPED because build failed"
+fi
+
+title "upload arvados images complete"
+
 title "Starting docker java-bwa-samtools build"
 
 ./build.sh java-bwa-samtools-image
@@ -49,13 +100,10 @@ title "docker build java-bwa-samtools complete"
 
 title "upload arvados/jobs image"
 
-docker push arvados/jobs
-
-ECODE=$?
-
-if [[ "$ECODE" != "0" ]]; then
-  title "!!!!!! upload arvados/jobs FAILED !!!!!!"
-  EXITCODE=$(($EXITCODE + $ECODE))
+if [[ "$ECODE" == "0" ]]; then
+  docker_push arvados/jobs
+else
+  title "upload arvados/jobs image SKIPPED because build failed"
 fi
 
 title "upload arvados/jobs image complete"