blob: b4546c00f22df8e839caf7b4bcd6f9ae21535b87 [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
Bartek Grzybowski2ee028b2020-03-05 14:35:29 +010015print("""- project:
Gary Wu213a8352017-06-16 13:44:28 -070016 name: onap-java
17 jobs:
18 - 'java-{project}'
Bartek Grzybowski2ee028b2020-03-05 14:35:29 +010019 project:""")
Gary Wu213a8352017-06-16 13:44:28 -070020
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("/", "_")
Bartek Grzybowski2ee028b2020-03-05 14:35:29 +010031 print(" - '{}':".format(project))
32 print(" repo: '{}'".format(repo))
33 if pompath:
34 print(" pom: '{}/pom.xml'".format(pompath))
Gary Wu213a8352017-06-16 13:44:28 -070035 else:
Bartek Grzybowski2ee028b2020-03-05 14:35:29 +010036 print(" pom: 'pom.xml'")