From a41f1b5c25c50f4d1c28dd38e212404210aee48e Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Wed, 13 Sep 2017 18:22:37 +0200 Subject: Auto retrieve docker image tag Signed-off-by: Sebastien Douheret --- scripts/xds-docker-create-container.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/xds-docker-create-container.sh b/scripts/xds-docker-create-container.sh index 52dfda3..0adc2d9 100755 --- a/scripts/xds-docker-create-container.sh +++ b/scripts/xds-docker-create-container.sh @@ -30,6 +30,16 @@ VERSION=4.0 DOCKER_USER=devel DEFIMAGE=$REGISTRY/$REPO/$NAME-$FLAVOUR:$VERSION +docker images |grep $DEFIMAGE 2>&1 > /dev/null +if [ "$?" = "1" ]; then + VERSION=`docker images $REGISTRY/$REPO/$NAME-$FLAVOUR:* --format "{{.Tag}}"` + if [ "$VERSION" = "" ]; then + echo "ERROR: cannot automatically retrieve image tag for $REGISTRY/$REPO/$NAME-$FLAVOUR" + exit 1 + fi + DEFIMAGE=$REGISTRY/$REPO/$NAME-$FLAVOUR:$VERSION +fi + function usage() { echo "Usage: $(basename $0) [image name]" >&2 -- cgit 1.2.3-korg