Fix OS_CLOUD export for image validation
[releng/global-jjb.git] / shell / docker-login.sh
index cac5186..ca4758f 100644 (file)
@@ -8,7 +8,7 @@
 # which accompanies this distribution, and is available at
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
-
+echo "---> docker-login.sh"
 # Log into a custom hosted docker registry and / or docker.io
 
 # $DOCKER_REGISTRY : Optional
@@ -79,7 +79,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 +101,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 +109,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"