From 83d6398df1bd45e8e63b13db2005c3f5b63a19c8 Mon Sep 17 00:00:00 2001 From: yathamravali Date: Wed, 6 Mar 2019 00:08:31 -0500 Subject: [PATCH] update BuildAndPushPrivate.sh with right options --- BuildAndPushPrivate.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BuildAndPushPrivate.sh b/BuildAndPushPrivate.sh index ed28523..d3836b1 100755 --- a/BuildAndPushPrivate.sh +++ b/BuildAndPushPrivate.sh @@ -4,9 +4,9 @@ # (C) Copyright IBM Corp. 2018. All Rights Reserved. # US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. -if ! [ $# -eq 4 ] ; then +if [ $# -eq 4 ] ; then echo "Requires five parameters: the image name you want, the tag you want, the ca domain name, the username to push it as, and the Dockerfile location" - echo "E.g. ./BuildAndPushPrivate.sh icp-nodejs-sample-amd64 1.0.0 docker-6/Dockerfile mycluster.icp" + echo "E.g. ./BuildAndPushPrivate.sh icp-nodejs-sample-amd64 1.0.0 mycluster.icp ibmcom docker-10/Dockerfile" exit; fi @@ -22,9 +22,9 @@ echo "Image name will be: ${image_name}" echo "Image tag will be: ${image_tag}" echo "CA domain will be: ${ca_domain}" echo "Docker user: ${docker_user}" -echo "File to use: ${file_to_use}" +echo "File to use: ${docker_file}" -docker login -u ${docker_id} +docker login -u ${docker_user} if [ $? -ne 0 ]; then echo "Didn't login successfully, bailing"; exit; @@ -37,7 +37,7 @@ if [ $? -ne 0 ]; then fi echo "Docker tagging..." -docker tag ${ca_domain}:8500/${image_name}:${image_tag} ${ca_domain}:8500/${image_name}:${image_tag} +docker tag ${image_name}:${image_tag} ${ca_domain}:8500/${image_name}:${image_tag} if [ $? -ne 0 ]; then echo "Didn't tag your image successfully, bailing"; exit; fi @@ -46,5 +46,5 @@ echo "Docker pushing..." docker push ${ca_domain}:8500/${image_name}:${image_tag} if [ $? -ne 0 ]; then echo "Didn't push your image successfully, bailing"; exit; - +fi echo "Done!"