mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user