# update a docker image with remote docker deamon (ssh) (pull/tag/push)
###########################################################################
# update-docker-image.sh <stage> <source_group> <destination_group> <image_name> <image_version>
###########################################################################
# upgrade-docker-image.sh qa smardigo smardigo keycloak 14.0.0.2
# upgrade-docker-image.sh prodnso smardigo smardigo connect-whitelabel-app latest

FROM="dev-harbor-01.smardigo.digital/$2/$4:$5"
TO="$1-harbor-01.smardigo.digital/$3/$4:$5"

echo
echo updating $TO with image from $FROM
echo

docker pull $FROM
docker tag $FROM $TO
docker push $TO
