mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
Merge pull request #487 from saurabh6790/prepare_ver_x_x
Prepare v{old_major}_x_x while releasing mjor version
This commit is contained in:
commit
b3bc4a6ffb
@ -57,6 +57,7 @@ def bump(bench_path, app, bump_type, from_branch, to_branch, remote, owner, repo
|
||||
assert bump_type in ['minor', 'major', 'patch', 'stable', 'prerelease']
|
||||
|
||||
repo_path = os.path.join(bench_path, 'apps', app)
|
||||
push_branch_for_old_major_version(bench_path, bump_type, app, repo_path, from_branch, to_branch, remote, owner)
|
||||
update_branches_and_check_for_changelog(repo_path, from_branch, to_branch, remote=remote)
|
||||
message = get_release_message(repo_path, from_branch=from_branch, to_branch=to_branch, remote=remote)
|
||||
|
||||
@ -299,3 +300,24 @@ def create_github_release(repo_path, tag_name, message, remote='upstream', owner
|
||||
raise
|
||||
return r
|
||||
|
||||
def push_branch_for_old_major_version(bench_path, bump_type, app, repo_path, from_branch, to_branch, remote, owner):
|
||||
if bump_type != 'major':
|
||||
return
|
||||
|
||||
current_version = get_current_version(repo_path)
|
||||
old_major_version_branch = "v{major}.x.x".format(major=current_version.split('.')[0])
|
||||
|
||||
click.confirm('Do you want to push {branch}?'.format(branch=old_major_version_branch), abort=True)
|
||||
|
||||
update_branch(repo_path, to_branch, remote=remote)
|
||||
|
||||
g = git.Repo(repo_path).git
|
||||
g.checkout(b=old_major_version_branch)
|
||||
|
||||
args = [
|
||||
'{old_major_version_branch}:{old_major_version_branch}'.format(old_major_version_branch=old_major_version_branch),
|
||||
]
|
||||
|
||||
print("Pushing {old_major_version_branch} ".format(old_major_version_branch=old_major_version_branch))
|
||||
print(g.push(remote, *args))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user