blob: 0fc538886b6dbd9756551f236f479a0183e840d0 [file] [log] [blame]
Gary Wu213a8352017-06-16 13:44:28 -07001#!/usr/bin/env python
Gary Wu5cccfa92017-08-02 12:03:10 -07002#
3# Copyright 2017 Huawei Technologies Co., Ltd.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
Gary Wu213a8352017-06-16 13:44:28 -070011import fileinput
12import os
13import subprocess
14
15print """- project:
16 name: onap-java
17 jobs:
18 - 'java-{project}'
19 project:"""
20
21for line in fileinput.input():
22 repo = line.strip()
23 isGroupRepo = subprocess.call("grep -s 'Group repo' {}/README.md > /dev/null".format(repo), shell=True) == 0
24 if not isGroupRepo:
25 pompaths = os.popen("./ls-top-poms.sh {}".format(repo)).readlines()
26 for pompath in pompaths:
27 pompath = pompath.strip()
28 project = repo.replace("/", "_")
29 if pompath:
30 project += "_" + pompath.replace("/", "_")
31 print " - '{}':".format(project)
32 print " repo: '{}'".format(repo)
33 if pompath:
34 print " pom: '{}/pom.xml'".format(pompath)
35 else:
36 print " pom: 'pom.xml'"