Update automated project templates
[releng/builder.git] / jjb / include-raw-check-poms.sh
1 #!/bin/bash
2
3 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
4 ##############################################################################
5 # Copyright (c) 2015 The Linux Foundation and others.
6 #
7 # All rights reserved. This program and the accompanying materials
8 # are made available under the terms of the Eclipse Public License v1.0
9 # which accompanies this distribution, and is available at
10 # http://www.eclipse.org/legal/epl-v10.html
11 #
12 # Contributors:
13 #   Thanh Ha (The Linux Foundation) - Initial implementation
14 ##############################################################################
15
16 # Clear workspace
17 rm -rf *
18
19 # Clone all ODL projects
20 for p in `ssh -p 29418 git.opendaylight.org gerrit ls-projects`
21 do
22   mkdir -p `dirname "$p"`
23   git clone "https://git.opendaylight.org/gerrit/$p.git" "$p"
24 done
25
26 # Check pom.xml for <repositories> and <pluginRepositories>
27 FILE=repos.txt
28
29 find . -name pom.xml | xargs grep -i '<repositories>\|<pluginRepositories>' > $FILE
30 [[ $(tr -d "\r\n" < $FILE|wc -c) -eq 0 ]] && rm $FILE
31
32 if [ -a $FILE ]
33 then
34     cat $FILE
35     echo "[ERROR] Repos with <repositories> and/or <pluginRepositories> sections found!"
36     exit 1
37 fi