aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2018-04-07 11:57:06 +0200
committerMartin Stockhammer <martin_s@apache.org>2018-04-07 11:57:06 +0200
commit5c1672522ba82e84a82977e36b6d39200b19554a (patch)
treea50c0b0b5b34a622696f7cea5d805e8a1e008856
parente72a9115a7fa4a1e820969f93c7d97e4a4b97392 (diff)
downloadarchiva-5c1672522ba82e84a82977e36b6d39200b19554a.tar.gz
archiva-5c1672522ba82e84a82977e36b6d39200b19554a.zip
Adding fix for older docker version
-rwxr-xr-xsrc/ci/scripts/container_webtest.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ci/scripts/container_webtest.sh b/src/ci/scripts/container_webtest.sh
index 65d4c15ec..e5020c407 100755
--- a/src/ci/scripts/container_webtest.sh
+++ b/src/ci/scripts/container_webtest.sh
@@ -98,6 +98,16 @@ cleanup() {
trap cleanup EXIT
+function docker_login() {
+ if [ ! -z "${DOCKER_HUB_PW}" ]; then
+ echo "${DOCKER_HUB_PW}" | docker login --username "${DOCKER_HUB_ID}" --password-stdin 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Seems to be older docker version."
+ docker login --username "${DOCKER_HUB_ID}" --password "${DOCKER_HUB_PW}"
+ fi
+ fi
+}
+
function build_image() {
echo "Building image ${TAG}"
DOCKER_DIR="${HERE}/../docker/${DOCKER_CFG}"
@@ -116,9 +126,7 @@ function build_image() {
function get_image() {
IMG_ID=$(docker images -q "${DOCKER_HUB_TAG}")
if [ -z "${IMG_ID}" ]; then
- if [ ! -z "${DOCKER_HUB_PW}" ]; then
- echo "${DOCKER_HUB_PW}" | docker login --username "${DOCKER_HUB_ID}" --password-stdin
- fi
+ docker_login
docker pull "${DOCKER_HUB_TAG}"
docker logout
IMG_ID=$(docker images -q "${DOCKER_HUB_TAG}")