From 076e23babf843cc26bae5224f05c6de1b894bbde Mon Sep 17 00:00:00 2001
From: Igor Witz <igor.witz@etu.utc.fr>
Date: Mon, 3 Jun 2019 23:03:28 +0100
Subject: [PATCH] fix: detect the right image name when there are many

---
 get-modified-image.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/get-modified-image.sh b/get-modified-image.sh
index 6d13e044..3b2605c7 100755
--- a/get-modified-image.sh
+++ b/get-modified-image.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# retrieve the name of the image that was modified in the latest commit
+# retrieve the name and the version of the image that was modified in the latest commit
 # this script should become obsolete as soon as a proper way of getting the modified files is added to Gitlab CI
 
 RES=""
@@ -17,7 +17,7 @@ then
 	exit 1
 fi
 
-RES=$(cat $RES/docker-compose.yml | grep image: | head -n1 | cut -d ':' -f2-)
+RES=$(cat $RES/docker-compose.yml | grep $RES | cut -d ':' -f2-)
 if [[ "$RES" == "" ]]
 then
 	echo "No image modified"
-- 
GitLab