add teams info into metadata
This commit is contained in:
@ -23,8 +23,8 @@ import otc_metadata.services
|
||||
data = otc_metadata.services.Services()
|
||||
|
||||
|
||||
def process_repositories(args, services):
|
||||
"""Checkout repositories
|
||||
def process_services(args, services):
|
||||
"""Process services
|
||||
|
||||
"""
|
||||
gitea_bp = dict(
|
||||
@ -68,7 +68,11 @@ def process_repositories(args, services):
|
||||
teams = [{"name": "docs-infra-team", "permission": "write"}]
|
||||
branch_protections_main = copy.deepcopy(gitea_bp)
|
||||
if "teams" in repo:
|
||||
for team in repo["teams"]:
|
||||
teams_def = repo["teams"]
|
||||
if "teams" in service:
|
||||
teams_def = service["teams"]
|
||||
if teams_def:
|
||||
for team in teams_def:
|
||||
branch_protections_main["approvals_whitelist_teams"].append(
|
||||
team["name"])
|
||||
teams.append(dict(
|
||||
@ -113,11 +117,6 @@ def main():
|
||||
required=True,
|
||||
help='Environment to be used as a source'
|
||||
)
|
||||
# parser.add_argument(
|
||||
# '--gitcontrol-repo',
|
||||
# required=True,
|
||||
# help='Gitcontrol repository url'
|
||||
# )
|
||||
parser.add_argument(
|
||||
'--work-dir',
|
||||
required=True,
|
||||
@ -127,7 +126,7 @@ def main():
|
||||
args = parser.parse_args()
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
process_repositories(args, data.all_services)
|
||||
process_services(args, data.all_services)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Reference in New Issue
Block a user