+ # csv column #5: latest branch
+ #
+
+ readarray -t array < ./${repolist};
+ i=0
+ csv[i]="${csv[i]},latest branch"
+ ((i++))
+ for line in "${array[@]}"
+ do
+ reponame=$(echo $line | awk -F "|" '{print $1}');
+ latestbranch=$(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);
+ #echo "DBUG: reponame=${reponame}"
+ #echo "DBUG: latestbranch=${latestbranch}"
+ echo "latest available branch for repo \"${reponame}\" is \"${latestbranch}\""
+ csv[i]="${csv[i]},${latestbranch}"
+ ((i++))
+ done
+ unset array
+ unset i
+ unset reponame
+ unset latestbranch
+
+ #
+ # csv column #6: INFO.yaml LC state (project lifecycle state based on INFO.yaml / per repo)
+ # csv column #7: WIKI LC state (project lifecycle state based on ONAP Dev Wiki / per project)
+ # csv column #8: LC state match shows a "match" if both LC states match
+ #
+
+ readarray -t array < ./${repolist};
+ i=0
+ csv[i]="${csv[i]},INFO.yaml LC state,WIKI LC state,LC state match"
+ ((i++))
+ for line in "${array[@]}"
+ do
+ reponame=$(echo $line | awk -F "|" '{print $1}');
+ project=$(echo $reponame | sed 's:/.*$::')
+
+ if [ -f ./${reponame}/INFO.yaml ] ; then
+ # check if repo/branch has a INFO.yaml
+ lifecycleproject=$(grep '^project: ' ./${reponame}/INFO.yaml | awk -F ":" '{print $2}' | sed 's:^ ::' | sed "s:'::g" | tr '[:upper:]' '[:lower:]' | sed 's/\r$//')
+ lifecyclestate=$(grep '^lifecycle_state: ' ./${reponame}/INFO.yaml | awk -F ":" '{print $2}' | sed 's:^ ::' | sed "s:'::g" | tr '[:upper:]' '[:lower:]' | sed 's/\r$//')
+ elif [ ${branch} != "master" ] && [ -f ../master/${reponame}/INFO.yaml ] ; then
+ # if current branch is not master AND if info.yaml not found in the current repo/branch THAN use INFO.yaml of repo/master if available
+ #echo "DBUG: branch=${branch} - checking master for INFO.yaml"
+ lifecycleproject=$(grep '^project: ' ../master/${reponame}/INFO.yaml | awk -F ":" '{print $2}' | sed 's:^ ::' | sed "s:'::g" | tr '[:upper:]' '[:lower:]' | sed 's/\r$//')
+ lifecyclestate=$(grep '^lifecycle_state: ' ../master/${reponame}/INFO.yaml | awk -F ":" '{print $2}' | sed 's:^ ::' | sed "s:'::g" | tr '[:upper:]' '[:lower:]' | sed 's/\r$//')
+ lifecyclestate="(${lifecyclestate})"
+ else
+ lifecyclestate="INFO.yaml not found"
+ fi
+
+ getwikilifecyclestate ${project}
+ # returns value in ${return_from_getwikilifecyclestate}
+
+ #echo "DBUG: working dir is ...";pwd
+ #echo "DBUG: lifecycleproject=${lifecycleproject}"
+ #echo "DBUG: lifecyclestate=${lifecyclestate}"
+ #echo "DBUG: wikilifecyclestate=${return_from_getwikilifecyclestate}"
+
+ #check if YAML.info LC state is not empty _AND_ if WIKI LC state is not empty _AND_ if YAML.info LC state contains WIKI LC state
+ if [[ ${lifecyclestate} != "" ]] && [[ ${return_from_getwikilifecyclestate} != "" ]] && [[ ${lifecyclestate} == *"${return_from_getwikilifecyclestate}"* ]]; then
+ lcstatesmatch="match"
+ else
+ lcstatesmatch=""
+ fi
+
+ csv[i]="${csv[i]},${lifecyclestate},${return_from_getwikilifecyclestate},${lcstatesmatch}"
+ ((i++))
+ done
+ unset array
+ unset i
+ unset reponame
+ unset project
+ unset lifecycleproject
+ unset lifecyclestate
+ unset lcstatesmatch
+
+ #
+ # csv column #9: RELEASE component (yes|maybe|unknown)