blob: 0da988083b39f6c5a5426c046e7f5b8f7e39d1ae [file] [log] [blame]
Gary Wu213a8352017-06-16 13:44:28 -07001#!/usr/bin/env python
2import fileinput
3import os
4import subprocess
5
6print """- project:
7 name: onap-java
8 jobs:
9 - 'java-{project}'
10 project:"""
11
12for line in fileinput.input():
13 repo = line.strip()
14 isGroupRepo = subprocess.call("grep -s 'Group repo' {}/README.md > /dev/null".format(repo), shell=True) == 0
15 if not isGroupRepo:
16 pompaths = os.popen("./ls-top-poms.sh {}".format(repo)).readlines()
17 for pompath in pompaths:
18 pompath = pompath.strip()
19 project = repo.replace("/", "_")
20 if pompath:
21 project += "_" + pompath.replace("/", "_")
22 print " - '{}':".format(project)
23 print " repo: '{}'".format(repo)
24 if pompath:
25 print " pom: '{}/pom.xml'".format(pompath)
26 else:
27 print " pom: 'pom.xml'"