From 1b9ca54af0f7f70c65382ebe748a22e6763130e6 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Sat, 1 Nov 2014 15:08:28 -0400 Subject: [PATCH] Make run-docker-tests.sh a bit smarter about detecting common failures. No issue # --- jenkins/run-docker-tests.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/jenkins/run-docker-tests.sh b/jenkins/run-docker-tests.sh index 8fbf562..8587996 100755 --- a/jenkins/run-docker-tests.sh +++ b/jenkins/run-docker-tests.sh @@ -9,7 +9,7 @@ title () { } docker_push () { - docker push $* + $DOCKER push $* ECODE=$? @@ -19,8 +19,28 @@ docker_push () { 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" -- 2.30.2