You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2019/07/26 21:40:38 UTC

[impala] 08/08: Add support to tag docker images when pushing them

This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 12575f8abff160be425445b47c1142958e4718bd
Author: Lars Volker <lv...@cloudera.com>
AuthorDate: Wed Jul 24 16:19:30 2019 -0700

    Add support to tag docker images when pushing them
    
    This change adds an optional flag -t to docker/push-images.sh which
    allows to specify a tag. Leaving it empty will omit adding a specific
    tag and docker will fall back to "latest".
    
    Testing: I tested this manually and confirmed that the flag works as
    expected.
    
    Change-Id: I370542127f190cc3e0be3facb3a0e691f101ef70
    Reviewed-on: http://gerrit.cloudera.org:8080/13913
    Reviewed-by: Lars Volker <lv...@cloudera.com>
    Tested-by: Lars Volker <lv...@cloudera.com>
---
 docker/push-images.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/docker/push-images.sh b/docker/push-images.sh
index 1310366..2c32d49 100755
--- a/docker/push-images.sh
+++ b/docker/push-images.sh
@@ -33,6 +33,9 @@ usage() {
   echo "     Append this image prefix to all images pushed to the registry. Required."
   echo "  -r <registry>"
   echo "     Push to this registry. Optional, if not specified pushes to docker hub."
+  echo "  -t <tag>"
+  echo "     Append this tag to all images before pushing them, Optional, defaults to"
+  echo "     empty."
   echo
   echo "Examples:"
   echo "To push to some user's repository on Docker Hub, with names like "
@@ -42,7 +45,8 @@ usage() {
 
 PREFIX=
 REGISTRY=
-while getopts "p:r:" OPTION
+TAG=
+while getopts "p:r:t:" OPTION
 do
   case "$OPTION" in
     p)
@@ -51,6 +55,9 @@ do
     r)
       REGISTRY="$OPTARG"
       ;;
+    t)
+      TAG="$OPTARG"
+      ;;
     ?)
       echo "Unknown option."
       usage
@@ -77,6 +84,9 @@ for IMAGE in ${IMAGES}; do
     DEST=$REGISTRY/
   fi
   DEST+="$PREFIX-$IMAGE"
+  if [[ -n "$TAG" ]]; then
+    DEST+=":$TAG"
+  fi
   docker image tag "$IMAGE" "$DEST"
   docker push "$DEST"
 done