Create offline data lists to cover Casablanca

Adding casablanca related data lists and changing the lists naming rule

Modifying related download scripts accordingly

Adding parameters for project version to download scripts to be able to
use version specific lists

Removing download-oom.sh as it should be done in helm charts
preparation and patching steps

Moving additional build related stuff to build directory

Adding missing tags

Issue-ID: OOM-1615

Change-Id: Ic5902f646a1f0f40ba615562f8d9b1a43cf8480b
Signed-off-by: Tomáš Levora <t.levora@partner.samsung.com>
diff --git a/build/creating_data/download-git-repos.sh b/build/creating_data/download-git-repos.sh
index 9d651d9..bb4a79f 100755
--- a/build/creating_data/download-git-repos.sh
+++ b/build/creating_data/download-git-repos.sh
@@ -1,3 +1,4 @@
+#! /usr/bin/env bash
 #   COPYRIGHT NOTICE STARTS HERE
 #
 #   Copyright 2018 © Samsung Electronics Co., Ltd.
@@ -16,21 +17,40 @@
 #
 #   COPYRIGHT NOTICE ENDS HERE
 
-lists_dir="$1"
+# fail fast
+set -e
 
-if [[ -z "$lists_dir" ]]; then
-    echo "Missing argument for lists_dir"
+usage () {
+    echo "Usage:"
+    echo -e "./$(basename $0) <repository list> [destination directory]\n"
+    echo "Examples:"
+    echo "  ./$(basename $0) onap_3.0.0 ./git-repo"
+}
+
+LIST="${1}"
+
+if [[ -z "${LIST}" ]]; then
+    echo "Missing argument for repository list"
     exit 1
 fi
 
-outdir="$2"
-if [[ -z "$outdir" ]]; then
-    outdir="./git-repo"
+OUTDIR="${2}"
+if [[ -z "${OUTDIR}" ]]; then
+    OUTDIR="./git-repo"
 fi
 
-mkdir -p "$outdir"
-cd "$outdir"
-# NOTE: will be better to use sh extension?
-sh $lists_dir/git_manual_list
-sh $lists_dir/git_repos_list
+mkdir -p "${OUTDIR}"
+cd "${OUTDIR}"
 
+
+while IFS=" " read -r REPO BRANCH remainder
+do
+        if [[ -z "${BRANCH}" ]]; then
+                git clone https://${REPO} --bare ${REPO}
+        else
+                git clone -b ${BRANCH} --single-branch https://${REPO} --bare ${REPO}
+        fi
+done < <(awk '$1 ~ /^[^;#]/' ${LIST})
+
+
+exit 0