summaryrefslogtreecommitdiffstats
path: root/tools/latestbranch.sh
diff options
context:
space:
mode:
authorThomas Kulik <thomas.kulik@telekom.de>2021-06-08 13:06:23 +0000
committerGerrit Code Review <gerrit@onap.org>2021-06-08 13:06:23 +0000
commitdbc24685bb9abd4a4acc18af99b20d889bff9faa (patch)
treee4e3775d3aa0f68f74aa2c4d950ab9da4db8ebd6 /tools/latestbranch.sh
parent1c93d1da4b011c5247d8d88c3625bbab6b542a6d (diff)
parent3353c6e1257561d79e7e0975c936ce6ffaa104fa (diff)
Merge "Update doc/tools"
Diffstat (limited to 'tools/latestbranch.sh')
-rwxr-xr-xtools/latestbranch.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/latestbranch.sh b/tools/latestbranch.sh
new file mode 100755
index 000000000..ae9dd1fc0
--- /dev/null
+++ b/tools/latestbranch.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# set -x
+
+repolist=$1
+source="git://cloud.onap.org/mirror"
+
+ #
+ # csv column #nn: latest branch
+ #
+
+ readarray -t array < ./${repolist};
+ i=0
+ csv[i]="${csv[i]},MASTER repo name"
+ ((i++))
+ for line in "${array[@]}"
+ do
+ reponame=$(echo $line | awk -F "|" '{print $1}');
+ csv[i]="${csv[i]},${reponame}"
+ ((i++))
+
+ #echo " "
+ #echo ${reponame}
+
+ git ls-remote -q --heads "${source}/${reponame}" | sed 's/^.*heads\///' | sed -nr '/^master$|^amsterdam$|^beijing$|^casablanca$|^dublin$|^elalto$|^frankfurt$|^guilin$|^honolulu$|^istanbul$/Ip' | tail -2 | head -1
+ #git ls-remote -q --heads "${source}/${reponame}" | sed 's/^.*heads\///'
+
+ done
+ unset array
+ unset i
+ unset reponame
+
+exit
+