Fixed auto detection of version
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 19 Oct 2017 12:47:21 +0000 (14:47 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 19 Oct 2017 12:47:21 +0000 (14:47 +0200)
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
scripts/xds-docker-create-container.sh

index f493dde..06d1edc 100755 (executable)
@@ -93,24 +93,24 @@ done
 # Dynamically retrieve image name
 if [ "$IMAGE" = "" ]; then
 
-    IMAGES_LIST=$(docker images $REGISTRY/$REPO/$NAME-$FLAVOUR --format '{{.Tag}}')
-    VER_NUM=$(echo "$IMAGES_LIST" | wc -l)
+    VERSION_LIST=$(docker images $REGISTRY/$REPO/$NAME-$FLAVOUR --format '{{.Tag}}')
+    VER_NUM=$(echo "$VERSION_LIST" | wc -l)
     if [ $VER_NUM -gt 1 ]; then
         echo "ERROR: more than one xds image found, please set explicitly the image to use !"
         echo "List of found images:"
-        echo "$IMAGES_LIST"
+        echo "$VERSION_LIST"
         exit 1
     elif [ $VER_NUM -lt 1 ]; then
         echo "ERROR: cannot automatically retrieve image tag for $REGISTRY/$REPO/$NAME-$FLAVOUR"
         exit 1
     fi
-    if [ "$IMAGES_LIST" = "" ]; then
+    if [ "$VERSION_LIST" = "" ]; then
         echo "ERROR: cannot automatically retrieve image tag for $REGISTRY/$REPO/$NAME-$FLAVOUR"
         usage
         exit 1
     fi
 
-    IMAGE=$REGISTRY/$REPO/$NAME-$FLAVOUR:$VERSION
+    IMAGE=$REGISTRY/$REPO/$NAME-$FLAVOUR:$VERSION_LIST
 fi
 
 USER=$(id -un)