Commit 144753c7 authored by sangeetha's avatar sangeetha

updated arguments changes

parent a4a5501c
......@@ -8,6 +8,7 @@ import logging
import os
import shutil
import sys
from typing import List
import git
import gitlab
......@@ -148,20 +149,12 @@ if __name__ == '__main__':
help="Client Name Tag"
)
ap.add_argument(
"--git_repos",
"-gr",
"--module_details",
"-md",
required=False,
default=None,
help="Git repos to be added in helm",
nargs="+"
)
ap.add_argument(
"--module_names",
"-mn",
required=False,
default=None,
help="Module names to be added in helm",
nargs="+"
type=json.loads,
help="Module details to be added in helm",
)
ap.add_argument(
"--exclude_files",
......@@ -175,11 +168,10 @@ if __name__ == '__main__':
_ilens_version = arguments["ilens_version"]
_release_version = arguments["release_version"]
_client_name = arguments['client_name']
_git_repos = arguments["git_repos"]
_module_names = arguments["module_names"]
_module_details = arguments['module_details']
_exclude_files = arguments["exclude_files"]
if not _ilens_version or not _release_version or not _client_name or not (_git_repos or _module_names) or not global_configmap:
print("global_configmap, git_repos, module_names, client_name, ilens_version and release_version details not found!!!!!")
if not _ilens_version or not _release_version or not _client_name or not _module_details or not global_configmap:
print("global_configmap, module_details, client_name, ilens_version and release_version details not found!!!!!")
sys.exit()
_branch = f"{_client_name}_{_ilens_version}.{_release_version}"
try:
......@@ -188,10 +180,9 @@ if __name__ == '__main__':
sys.exit()
with open("config.json", "r") as f:
data = json.load(f)
if _git_repos:
data['git_modules'] = [x for x in data['git_modules'] if x['git_link'] in _git_repos]
else:
data['git_modules'] = [x for x in data['git_modules'] if x['module_name'] in _module_names]
_git_repos = [x['git_link'] for x in _module_details if x.get('git_link')]
_module_names = [x['module_name'] for x in _module_details if x.get('module_name')]
data['git_modules'] = [x for x in data['git_modules'] if (x['module_name'] in _module_names) or (x['git_link'] in _git_repos)]
global_config_data = convert_yaml_to_json(global_configmap)
remove_all_files_from_repo(exclude_file=_exclude_files)
for _data in data.get('git_modules'):
......@@ -203,7 +194,7 @@ if __name__ == '__main__':
module_path = os.path.join("tmp")
module_name = _data['module_name']
module_name = _data.get('module_name') or git_link.split("/")[-1].split(".git")
module_path = os.path.join(module_path, module_name)
if not os.path.exists(module_path):
os.makedirs(module_path)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment