X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Finclude-raw-check-poms.sh;h=7ba7f699061112b35b7970067e4fa5f0ab3fb3b1;hb=a108c9db40f62deba48e8c2a8741a274ae9e19a3;hp=929e48b332f09885782cff99c49d2c5a456d0e9d;hpb=d7957b81bd0b4bd5d0fa025a843f221d3c1d2b4b;p=releng%2Fbuilder.git diff --git a/jjb/include-raw-check-poms.sh b/jjb/include-raw-check-poms.sh index 929e48b33..7ba7f6990 100644 --- a/jjb/include-raw-check-poms.sh +++ b/jjb/include-raw-check-poms.sh @@ -1,6 +1,5 @@ #!/bin/bash - -# @License EPL-1.0 +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2015 The Linux Foundation and others. # @@ -14,19 +13,45 @@ ############################################################################## # Clear workspace -rm -rf * +rm -rf -- "${WORKSPACE:?}"/* + +# Create python script to parse json +cat > "${WORKSPACE}/parse_json.py" << EOF +import json +import sys + +obj=json.load(sys.stdin) +for key in obj.keys(): + print(key) + +EOF # Clone all ODL projects -for p in `ssh -p 29418 git.opendaylight.org gerrit ls-projects` +curl -s --header "Accept: application/json" \ + https://git.opendaylight.org/gerrit/projects/ | \ + tail -n +2 > "${WORKSPACE}/projects.json" +for p in $(python "${WORKSPACE}/parse_json.py" < "${WORKSPACE}/projects.json") do - mkdir -p `dirname "$p"` - git clone "https://git.opendaylight.org/gerrit/$p.git" "$p" + # Ignore non-projects and archived projects + if [ "$p" == "All-Users" ] || \ + [ "$p" == "affinity" ] || \ + [ "$p" == "integration" ] || \ + [ "$p" == "net-virt-platform" ] || \ + [ "$p" == "opendove" ] || \ + [ "$p" == "plugin2oc" ] || \ + # Also ignore projects known to deploy to non-ODL repositories + [ "$p" == "yangide" ] + then + continue + fi + mkdir -p "$(dirname "$p")" + git clone "https://git.opendaylight.org/gerrit/$p.git" "$p" done # Check pom.xml for and FILE=repos.txt -find . -name pom.xml | xargs grep -i '\|' > $FILE +find . -name pom.xml -print0 | xargs -0 grep -i '\|' > "$FILE" [[ $(tr -d "\r\n" < $FILE|wc -c) -eq 0 ]] && rm $FILE if [ -a $FILE ]