X-Git-Url: https://git.arvados.org/arvados-dev.git/blobdiff_plain/1b9ca54af0f7f70c65382ebe748a22e6763130e6..7efe1eb66d31585bd6cd4a52ef0d12e0bdd91a88:/jenkins/run-docker-tests.sh diff --git a/jenkins/run-docker-tests.sh b/jenkins/run-docker-tests.sh index 8587996..e0c2288 100755 --- a/jenkins/run-docker-tests.sh +++ b/jenkins/run-docker-tests.sh @@ -9,9 +9,14 @@ title () { } docker_push () { - $DOCKER push $* - - ECODE=$? + # 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 !!!!!!" @@ -19,6 +24,14 @@ docker_push () { fi } +timer_reset() { + t0=$SECONDS +} + +timer() { + echo -n "$(($SECONDS - $t0))s" +} + # Sanity check if ! [[ -n "$WORKSPACE" ]]; then echo >&2 @@ -44,6 +57,8 @@ fi # DOCKER title "Starting docker build" +timer_reset + # clean up the docker build environment cd "$WORKSPACE" cd docker @@ -63,10 +78,12 @@ if [[ "$ECODE" != "0" ]]; then EXITCODE=$(($EXITCODE + $ECODE)) fi -title "docker build complete" +title "docker build complete (`timer`)" title "uploading images" +timer_reset + if [[ "$ECODE" == "0" ]]; then docker_push arvados/api docker_push arvados/compute @@ -78,10 +95,12 @@ else title "upload arvados images SKIPPED because build failed" fi -title "upload arvados images complete" +title "upload arvados images complete (`timer`)" title "Starting docker java-bwa-samtools build" +timer_reset + ./build.sh java-bwa-samtools-image ECODE=$? @@ -91,16 +110,17 @@ if [[ "$ECODE" != "0" ]]; then EXITCODE=$(($EXITCODE + $ECODE)) fi -title "docker build java-bwa-samtools complete" +title "docker build java-bwa-samtools complete (`timer`)" title "upload arvados/jobs image" +timer_reset 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" +title "upload arvados/jobs image complete (`timer`)" exit $EXITCODE