[ARVADOS-DEV] updated: b6a5513611786d2c0a513bac3ab2db00d84bf289

git at public.curoverse.com git at public.curoverse.com
Tue May 26 11:57:30 EDT 2015


Summary of changes:
 jenkins/run-docker-tests.sh | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

  discards  a1fe656edcd674ae996f3e70f19c063679158e05 (commit)
  discards  1e7b6aa1f16e06b796e3ed3f66c48f38a9287a5d (commit)
  discards  bb48082657c79156ad9af20d71c1ca73eafdf0fa (commit)
  discards  6a1a627a78a021aa164bfd1136bb5396e1defd95 (commit)
       via  b6a5513611786d2c0a513bac3ab2db00d84bf289 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (a1fe656edcd674ae996f3e70f19c063679158e05)
            \
             N -- N -- N (b6a5513611786d2c0a513bac3ab2db00d84bf289)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b6a5513611786d2c0a513bac3ab2db00d84bf289
Author: Nico Cesar <nico at nicocesar.com>
Date:   Thu May 21 14:35:54 2015 -0400

    6035: add support for --upload as an option
    
    refs #6035

diff --git a/jenkins/run-docker-tests.sh b/jenkins/run-docker-tests.sh
index 5be7b99..4f584d8 100755
--- a/jenkins/run-docker-tests.sh
+++ b/jenkins/run-docker-tests.sh
@@ -1,27 +1,91 @@
 #!/bin/bash
 
+function usage {
+    echo >&2
+    echo >&2 "usage: $0 [options]"
+    echo >&2
+    echo >&2 "$0 options:"
+    echo >&2 "  -t, --tags [csv_tags]         comma separated tags"
+    echo >&2 "  -u, --upload                  Upload the images (docker push)"
+    echo >&2 "  -h, --help                    Display this help and exit"
+    echo >&2
+    echo >&2 "  If no options are given, just builds the images."
+}
+
+upload=false
+
+# NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros).
+TEMP=`getopt -o hut: \
+    --long help,upload,tags: \
+    -n "$0" -- "$@"`
+
+if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi
+# Note the quotes around `$TEMP': they are essential!
+eval set -- "$TEMP"
+
+while [ $# -ge 1 ]
+do
+    case $1 in
+        -u | --upload)
+            upload=true
+            shift
+            ;;
+        -t | --tags)
+            case "$2" in
+                "")
+                  echo "ERROR: --tags needs a parameter";
+                  usage;
+                  exit 1
+                  ;;
+                *)
+                  tags=$2;
+                  shift 2
+                  ;;
+            esac
+            ;;
+        --)
+            shift
+            break
+            ;;
+        *)
+            usage
+            exit 1
+            ;;
+    esac
+done
+
+
 EXITCODE=0
 
 COLUMNS=80
 
 title () {
-  printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
+    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
+    echo $tags
+    if [[ ! -z "$tags" ]]
+    then
+        for tag in $( echo $tags|tr "," " " )
+        do
+             $DOCKER tag $1 $1:$tag
+        done
     fi
-  done
 
-  if [[ "$ECODE" != "0" ]]; then
-    title "!!!!!! docker push $* failed !!!!!!"
-    EXITCODE=$(($EXITCODE + $ECODE))
-  fi
+    # 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
 }
 
 timer_reset() {
@@ -34,10 +98,10 @@ timer() {
 
 # Sanity check
 if ! [[ -n "$WORKSPACE" ]]; then
-  echo >&2
-  echo >&2 "Error: WORKSPACE environment variable not set"
-  echo >&2
-  exit 1
+    echo >&2
+    echo >&2 "Error: WORKSPACE environment variable not set"
+    echo >&2
+    exit 1
 fi
 
 echo $WORKSPACE
@@ -46,12 +110,12 @@ echo $WORKSPACE
 DOCKER=`which docker.io`
 
 if [[ "$DOCKER" == "" ]]; then
-  DOCKER=`which docker`
+    DOCKER=`which docker`
 fi
 
 if [[ "$DOCKER" == "" ]]; then
-  title "Error: you need to have docker installed. Could not find the docker executable."
-  exit 1
+    title "Error: you need to have docker installed. Could not find the docker executable."
+    exit 1
 fi
 
 # DOCKER
@@ -74,8 +138,8 @@ cp $HOME/docker/config.yml .
 ECODE=$?
 
 if [[ "$ECODE" != "0" ]]; then
-  title "!!!!!! docker BUILD FAILED !!!!!!"
-  EXITCODE=$(($EXITCODE + $ECODE))
+    title "!!!!!! docker BUILD FAILED !!!!!!"
+    EXITCODE=$(($EXITCODE + $ECODE))
 fi
 
 title "docker build complete (`timer`)"
@@ -84,21 +148,24 @@ title "uploading images"
 
 timer_reset
 
-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/keepproxy
-  docker_push arvados/shell
-  docker_push arvados/sso
+if [[ "$ECODE" != "0" ]]; then
+    title "upload arvados images SKIPPED because build failed"
 else
-  title "upload arvados images SKIPPED because build failed"
+    if [[ $upload == true ]]; then 
+        docker_push arvados/api
+        docker_push arvados/compute
+        docker_push arvados/doc
+        docker_push arvados/workbench
+        docker_push arvados/keep
+        docker_push arvados/keepproxy
+        docker_push arvados/shell
+        docker_push arvados/sso
+        title "upload arvados images complete (`timer`)"
+    else
+        title "upload arvados images SKIPPED because no --upload option set"
+    fi
 fi
 
-title "upload arvados images complete (`timer`)"
-
 title "Starting docker java-bwa-samtools build"
 
 timer_reset
@@ -108,21 +175,24 @@ timer_reset
 ECODE=$?
 
 if [[ "$ECODE" != "0" ]]; then
-  title "!!!!!! docker java-bwa-samtools BUILD FAILED !!!!!!"
-  EXITCODE=$(($EXITCODE + $ECODE))
+    title "!!!!!! docker java-bwa-samtools BUILD FAILED !!!!!!"
+    EXITCODE=$(($EXITCODE + $ECODE))
 fi
 
 title "docker build java-bwa-samtools complete (`timer`)"
 
-title "upload arvados/jobs image"
-
 timer_reset
-if [[ "$ECODE" == "0" ]]; then
-  docker_push arvados/jobs
+
+if [[ "$ECODE" != "0" ]]; then
+    title "upload arvados/jobs image SKIPPED because build failed"
 else
-  title "upload arvados/jobs image SKIPPED because build failed"
+    if [[ $upload == true ]]; then 
+        title "upload arvados/jobs image"
+        docker_push arvados/jobs
+        title "upload arvados/jobs image complete (`timer`)"
+    else
+        title "upload arvados images SKIPPED because no --upload option set"
+    fi
 fi
 
-title "upload arvados/jobs image complete (`timer`)"
-
 exit $EXITCODE

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list