Gary Wu | 213a835 | 2017-06-16 13:44:28 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | import fileinput |
| 3 | import os |
| 4 | import subprocess |
| 5 | |
| 6 | print """- project: |
| 7 | name: onap-java |
| 8 | jobs: |
| 9 | - 'java-{project}' |
| 10 | project:""" |
| 11 | |
| 12 | for 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'" |