2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2015 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
12 # Thanh Ha (The Linux Foundation) - Initial implementation
13 ##############################################################################
16 rm -rf -- "${WORKSPACE:?}"/*
18 # Create python script to parse json
19 cat > "${WORKSPACE}/parse_json.py" << EOF
23 obj=json.load(sys.stdin)
24 for key in obj.keys():
29 # Clone all ODL projects
30 curl -s --header "Accept: application/json" \
31 https://git.opendaylight.org/gerrit/projects/ | \
32 tail -n +2 > "${WORKSPACE}/projects.json"
33 for p in $(python "${WORKSPACE}/parse_json.py" < "${WORKSPACE}/projects.json")
35 # Ignore non-projects and archived projects
36 if [ "$p" == "All-Users" ] || \
37 [ "$p" == "affinity" ] || \
38 [ "$p" == "integration" ] || \
39 [ "$p" == "net-virt-platform" ] || \
40 [ "$p" == "opendove" ] || \
41 [ "$p" == "plugin2oc" ] || \
42 # Also ignore projects known to deploy to non-ODL repositories
47 mkdir -p "$(dirname "$p")"
48 git clone "https://git.opendaylight.org/gerrit/$p.git" "$p"
51 # Check pom.xml for <repositories> and <pluginRepositories>
54 find . -name pom.xml -print0 | xargs -0 grep -i '<repositories>\|<pluginRepositories>' > "$FILE"
55 [[ $(tr -d "\\r\\n" < $FILE|wc -c) -eq 0 ]] && rm $FILE
60 echo "[ERROR] Repos with <repositories> and/or <pluginRepositories> sections found!"