Add comment to automatically generated docker list

Add comment to docker image list generated by docker-images-collector.sh
to reffer to commit id in case of ONAP or to project in other cases

Issue-ID: OOM-1884

Change-Id: I7ff32fae84db3476495eb2e560c3bf61e41e2ddb
Signed-off-by: Tomáš Levora <t.levora@partner.samsung.com>
diff --git a/build/creating_data/docker-images-collector.sh b/build/creating_data/docker-images-collector.sh
index 7e468c4..e2b56fa 100755
--- a/build/creating_data/docker-images-collector.sh
+++ b/build/creating_data/docker-images-collector.sh
@@ -106,12 +106,17 @@
 # Create the list from all enabled subsystems
 echo "Creating the list..."
 if [ "${PROJECT}" == "onap" ]; then
+    COMMENT="OOM commit $(git --git-dir="${PROJECT_DIR}/../../.git" rev-parse HEAD)"
     for subsystem in `parse_yaml "${PROJECT_DIR}/values.yaml"`; do
         create_list ${subsystem}
-    done
+    done | sort -u > ${LIST}
 else
-    create_list ${PROJECT}
-fi | sort -u > ${LIST}
+    COMMENT="${PROJECT}"
+    create_list ${PROJECT} | sort -u > ${LIST}
+fi
+
+# Add comment reffering to the project
+sed -i "1i# generated from ${COMMENT}" "${LIST}"
 
 echo -e ${MSG}
 echo -e 'The list has been created:\n '"${LIST}"