From 3353c6e1257561d79e7e0975c936ce6ffaa104fa Mon Sep 17 00:00:00 2001 From: thmsdt Date: Tue, 1 Jun 2021 04:42:34 -0700 Subject: Update doc/tools Issue-ID: DOC-745 Signed-off-by: thmsdt Change-Id: I5ede64f51d5beb82d146c412a0915e1e59cd9779 --- tools/latestbranch.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tools/latestbranch.sh (limited to 'tools/latestbranch.sh') 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 + -- cgit 1.2.3-korg