added preprod branch script #87
@ -88,7 +88,7 @@ def process_repositories(args, service):
|
|||||||
"repo": repo['repo']
|
"repo": repo['repo']
|
||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not repo_dir.exists():
|
if not repo_dir.exists():
|
||||||
try:
|
try:
|
||||||
git_repo = Repo.clone_from(repo_url, repo_dir, branch="main")
|
git_repo = Repo.clone_from(repo_url, repo_dir, branch="main")
|
||||||
@ -112,7 +112,7 @@ def process_repositories(args, service):
|
|||||||
return
|
return
|
||||||
|
|
||||||
branch_name = args.branch_name
|
branch_name = args.branch_name
|
||||||
|
|
||||||
# Check if branch exists remotely
|
# Check if branch exists remotely
|
||||||
remote_branch_exists = False
|
remote_branch_exists = False
|
||||||
try:
|
try:
|
||||||
@ -129,7 +129,7 @@ def process_repositories(args, service):
|
|||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning(f"Error checking for remote branch: {e}")
|
logging.warning(f"Error checking for remote branch: {e}")
|
||||||
|
|
||||||
if remote_branch_exists:
|
if remote_branch_exists:
|
||||||
# Branch exists, checkout and merge main into it
|
# Branch exists, checkout and merge main into it
|
||||||
logging.debug(f"Branch {branch_name} exists, merging main into it")
|
logging.debug(f"Branch {branch_name} exists, merging main into it")
|
||||||
@ -172,7 +172,7 @@ def process_repositories(args, service):
|
|||||||
"error": f"Error pushing branch {branch_name}: {e}",
|
"error": f"Error pushing branch {branch_name}: {e}",
|
||||||
"repo": target_repo['repo']
|
"repo": target_repo['repo']
|
||||||
})
|
})
|
||||||
|
|
||||||
if len(error_list) != 0:
|
if len(error_list) != 0:
|
||||||
logging.error("The following errors have happened:")
|
logging.error("The following errors have happened:")
|
||||||
logging.error(error_list)
|
logging.error(error_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user