More scripts
This commit is contained in:
parent
7f1b8f4d56
commit
075237b565
@ -43,6 +43,8 @@ def process_repositories(args, service):
|
|||||||
url_to = None
|
url_to = None
|
||||||
|
|
||||||
for repo in service["repositories"]:
|
for repo in service["repositories"]:
|
||||||
|
if repo["cloud_environments"][0] != args.cloud_environment:
|
||||||
|
continue
|
||||||
logging.debug(f"Processing repository {repo}")
|
logging.debug(f"Processing repository {repo}")
|
||||||
repo_dir = pathlib.Path(workdir, repo["type"], repo["repo"])
|
repo_dir = pathlib.Path(workdir, repo["type"], repo["repo"])
|
||||||
|
|
||||||
@ -88,6 +90,13 @@ def process_repositories(args, service):
|
|||||||
)
|
)
|
||||||
|
|
||||||
for doc in data.docs_by_service_type(service["service_type"]):
|
for doc in data.docs_by_service_type(service["service_type"]):
|
||||||
|
cloud_environment_doc_check = False
|
||||||
|
for cloud_environment_doc in doc["cloud_environments"]:
|
||||||
|
if cloud_environment_doc["name"] == args.cloud_environment:
|
||||||
|
cloud_environment_doc_check = True
|
||||||
|
break
|
||||||
|
if cloud_environment_doc_check is False:
|
||||||
|
continue
|
||||||
logging.debug(f"Analyzing document {doc}")
|
logging.debug(f"Analyzing document {doc}")
|
||||||
if args.document_type and doc.get("type") != args.document_type:
|
if args.document_type and doc.get("type") != args.document_type:
|
||||||
logging.info(
|
logging.info(
|
||||||
@ -187,12 +196,26 @@ def main():
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Open Pull Request using `gh` utility (need to be present).",
|
help="Open Pull Request using `gh` utility (need to be present).",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--cloud-environment",
|
||||||
|
required=True,
|
||||||
|
default="eu_de",
|
||||||
|
help="Cloud Environment. Default: eu_de",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
service = data.service_dict.get(args.service_type)
|
service = data.get_service_with_repo_by_service_type(service_type=args.service_type)
|
||||||
if not service:
|
if not service:
|
||||||
warnings.warn(f"Service {args.service_type} was not found in metadata")
|
warnings.warn(f"Service {args.service_type} was not found in metadata")
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
|
cloud_environment_service_check = False
|
||||||
|
for cloud_environment_service in service["cloud_environments"]:
|
||||||
|
if cloud_environment_service["name"] == args.cloud_environment:
|
||||||
|
cloud_environment_service_check = True
|
||||||
|
break
|
||||||
|
if cloud_environment_service_check is False:
|
||||||
|
warnings.warn(f"Service {args.service_type} has no cloud environment {args.cloud_environment}")
|
||||||
|
os.exit(1)
|
||||||
|
|
||||||
process_repositories(args, service)
|
process_repositories(args, service)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user