mirror of
https://github.com/frappe/bench.git
synced 2025-01-25 07:58:24 +00:00
make bench release available for app developers
This commit is contained in:
parent
489663de0a
commit
95eae6d3b4
@ -116,13 +116,14 @@ def backup_all_sites():
|
|||||||
|
|
||||||
|
|
||||||
@click.command('release')
|
@click.command('release')
|
||||||
@click.argument('app', type=click.Choice(['frappe', 'erpnext', 'erpnext_shopify', 'paypal_integration', 'schools']))
|
@click.argument('app')
|
||||||
@click.argument('bump-type', type=click.Choice(['major', 'minor', 'patch']))
|
@click.argument('bump-type', type=click.Choice(['major', 'minor', 'patch']))
|
||||||
|
@click.argument('owner', default='frappe')
|
||||||
@click.option('--develop', default='develop')
|
@click.option('--develop', default='develop')
|
||||||
@click.option('--master', default='master')
|
@click.option('--master', default='master')
|
||||||
def release(app, bump_type, develop, master):
|
def release(app, bump_type, develop, master, owner):
|
||||||
"Release app (internal to the Frappe team)"
|
"Release app (internal to the Frappe team)"
|
||||||
from bench.release import release
|
from bench.release import release
|
||||||
repo = os.path.join('apps', app)
|
repo = os.path.join('apps', app)
|
||||||
release(repo, bump_type, develop, master)
|
release(repo, bump_type, develop, master, owner)
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ repo_map = {
|
|||||||
'schools': 'schools'
|
'schools': 'schools'
|
||||||
}
|
}
|
||||||
|
|
||||||
def release(repo, bump_type, develop, master):
|
def release(repo, bump_type, develop, master, owner):
|
||||||
if not get_config(".").get('release_bench'):
|
if not get_config(".").get('release_bench'):
|
||||||
print 'bench not configured to release'
|
print 'bench not configured to release'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -36,9 +36,9 @@ def release(repo, bump_type, develop, master):
|
|||||||
github_password = getpass.getpass()
|
github_password = getpass.getpass()
|
||||||
r = requests.get('https://api.github.com/user', auth=HTTPBasicAuth(github_username, github_password))
|
r = requests.get('https://api.github.com/user', auth=HTTPBasicAuth(github_username, github_password))
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
bump(repo, bump_type, develop=develop, master=master)
|
bump(repo, bump_type, develop=develop, master=master, owner=owner)
|
||||||
|
|
||||||
def bump(repo, bump_type, develop='develop', master='master', remote='upstream'):
|
def bump(repo, bump_type, develop='develop', master='master', remote='upstream', owner='frappe'):
|
||||||
assert bump_type in ['minor', 'major', 'patch']
|
assert bump_type in ['minor', 'major', 'patch']
|
||||||
update_branches_and_check_for_changelog(repo, bump_type, develop=develop, master=master, remote=remote)
|
update_branches_and_check_for_changelog(repo, bump_type, develop=develop, master=master, remote=remote)
|
||||||
message = get_release_message(repo, develop_branch=develop, master_branch=master)
|
message = get_release_message(repo, develop_branch=develop, master_branch=master)
|
||||||
@ -56,7 +56,7 @@ def bump(repo, bump_type, develop='develop', master='master', remote='upstream')
|
|||||||
commit_changes(repo, new_version)
|
commit_changes(repo, new_version)
|
||||||
tag_name = create_release(repo, new_version, develop_branch=develop, master_branch=master)
|
tag_name = create_release(repo, new_version, develop_branch=develop, master_branch=master)
|
||||||
push_release(repo, develop_branch=develop, master_branch=master)
|
push_release(repo, develop_branch=develop, master_branch=master)
|
||||||
create_github_release('frappe', repo, tag_name, message)
|
create_github_release(owner, repo, tag_name, message)
|
||||||
print 'Released {tag} for {repo}'.format(tag=tag_name, repo=repo)
|
print 'Released {tag} for {repo}'.format(tag=tag_name, repo=repo)
|
||||||
|
|
||||||
def update_branches_and_check_for_changelog(repo, bump_type, develop='develop', master='master', remote='upstream'):
|
def update_branches_and_check_for_changelog(repo, bump_type, develop='develop', master='master', remote='upstream'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user