Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

update BuildAndPushPrivate.sh with right options #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions BuildAndPushPrivate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;
Expand All @@ -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
Expand All @@ -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!"