thmsdt | 3353c6e | 2021-06-01 04:42:34 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # set -x |
| 3 | |
| 4 | repolist=$1 |
| 5 | source="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 | |
| 32 | exit |
| 33 | |