[release] Add

Add release script
This commit is contained in:
Alexander Trofimov
2020-12-07 11:05:36 +03:00
parent a9aead5547
commit 27e7cc2253
2 changed files with 69 additions and 0 deletions

View File

@ -70,6 +70,9 @@ def print_info(info=""):
print("------------------------------------------")
return
def print_error(error=""):
print("\033[91m" + error + "\033[0m")
def print_list(list):
print('[%s]' % ', '.join(map(str, list)))
return
@ -413,6 +416,38 @@ def get_repositories():
result["core-fonts"] = [False, False]
return result
def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=False):
print("[git] create pull request: " + repo)
url = "https://github.com/ONLYOFFICE/" + repo + ".git"
if config.option("git-protocol") == "ssh":
url = "git@github.com:ONLYOFFICE/" + repo + ".git"
folder = get_script_dir() + "/../../" + repo
if is_current_dir:
folder = repo
is_not_exit = False
if not is_dir(folder):
retClone = cmd("git", ["clone", url, folder], is_no_errors)
if retClone != 0:
return
is_not_exit = True
old_cur = os.getcwd()
os.chdir(folder)
cmd("git", ["checkout", "-f", config.option("branch")], is_no_errors)
cmd("git", ["pull"], is_no_errors)
for branch_to in branches_to:
if "" != run_command("git log origin/" + branch_to + "..origin/" + config.option("branch"))["stdout"]:
cmd("git", ["checkout", "-f", branch_to], is_no_errors)
cmd("git", ["pull"], is_no_errors)
cmd("hub", ["pull-request", "--force", "--base", branch_to, "--head", config.option("branch"), "--no-edit"], is_no_errors)
if 0 != cmd("git", ["merge", "origin/" + config.option("branch"), "--no-ff", "--no-edit"], is_no_errors):
print_error("[git] Conflicts merge " + "origin/" + config.option("branch") + " to " + branch_to + " in repo " + url)
cmd("git", ["merge", "--abort"], is_no_errors)
else:
cmd("git", ["push"], is_no_errors)
os.chdir(old_cur)
return
def update_repositories(repositories):
for repo in repositories:
value = repositories[repo]