X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fdocker-login.sh;h=72d420f30602d47a785cb4eddb6948ffb8e0cc27;hb=c8b9acd166fcbd88139a65f7721e522980a0e013;hp=cac51867b5757a7435ac6bbb84f749d8ad35a6ad;hpb=bd666934503c622d939adaccc6d1be7066c6a214;p=releng%2Fglobal-jjb.git diff --git a/shell/docker-login.sh b/shell/docker-login.sh index cac51867..72d420f3 100644 --- a/shell/docker-login.sh +++ b/shell/docker-login.sh @@ -8,7 +8,6 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## - # Log into a custom hosted docker registry and / or docker.io # $DOCKER_REGISTRY : Optional @@ -43,7 +42,7 @@ #2) User logging into docker.io with docker version <17.06.0 email optional #3) User logging into docker.io wiht docker version >= 17.06.0 cannot use email flag - +echo "---> docker-login.sh" # Ensure we fail the job if any steps fail set -eu -o pipefail @@ -79,7 +78,7 @@ set_creds() { # Login to the registry do_login() { docker_version=$( docker -v | awk '{print $3}') - if version_lt $docker_version "17.06.0" && \ + if version_lt "$docker_version" "17.06.0" && \ "$DOCKERHUB_REGISTRY" == "docker.io" && \ "$DOCKERHUB_EMAIL:-none" != 'none' then @@ -101,7 +100,7 @@ then # docker login requests an email address if nothing is passed to it # Nexus, however, does not need this and ignores the value - set_creds $REGISTRY + set_creds "$REGISTRY" do_login "$REGISTRY" none done fi @@ -109,7 +108,7 @@ fi # Login to docker.io after determining if email is needed. if [ "${DOCKERHUB_REGISTRY:-none}" != 'none' ] then - set_creds $DOCKERHUB_REGISTRY + set_creds "$DOCKERHUB_REGISTRY" if [ "${DOCKERHUB_EMAIL:-none}" != 'none' ] then do_login "$DOCKERHUB_REGISTRY" "$DOCKERHUB_EMAIL" @@ -117,3 +116,5 @@ then do_login "$DOCKERHUB_REGISTRY" none fi fi + +echo "---> docker-login.sh ends"