blob: ae9dd1fc0d77308e4145f931bc738531a9a8e2ef [file] [log] [blame]
thmsdt3353c6e2021-06-01 04:42:34 -07001#!/bin/bash
2# set -x
3
4repolist=$1
5source="git://cloud.onap.org/mirror"
6
7 #
8 # csv column #nn: latest branch
9 #
10
11 readarray -t array < ./${repolist};
12 i=0
13 csv[i]="${csv[i]},MASTER repo name"
14 ((i++))
15 for line in "${array[@]}"
16 do
17 reponame=$(echo $line | awk -F "|" '{print $1}');
18 csv[i]="${csv[i]},${reponame}"
19 ((i++))
20
21 #echo " "
22 #echo ${reponame}
23
24 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
25 #git ls-remote -q --heads "${source}/${reponame}" | sed 's/^.*heads\///'
26
27 done
28 unset array
29 unset i
30 unset reponame
31
32exit
33