def mark_version_as_alpha(branch_name): util.chdir_repo('commcare-core') subprocess.call('git checkout {}'.format(branch_name), shell=True) subprocess.call('git pull origin {}'.format(branch_name), shell=True) replace_func(set_dev_tag_to_alpha, 'application/build.properties') commit_message = 'Automated commit adding dev tag to commcare version' review_and_commit_changes(branch_name, commit_message) subprocess.call('git checkout master', shell=True) util.chdir_base()
def create_tags_for_repos(branch_name, tag_name): """ Creates the release tag from provided branch. """ print("creating release tags '{}' from '{}' branches".format(tag_name, branch_name)) for repo in REPOS: util.chdir_repo(repo) create_tag_from_branch(branch_name, tag_name) util.chdir_base()
def create_tags_for_repos(branch_name, tag_name): """ Creates the release tag from provided branch. """ print("creating release tags '{}' from '{}' branches".format( tag_name, branch_name)) for repo in REPOS: util.chdir_repo(repo) create_tag_from_branch(branch_name, tag_name) util.chdir_base()
def create_hotfix_tags(hotfix_repos, version): """ Create hotfix tags from hotfix branch for given repos. """ branch_name = "{}{}".format(BRANCH_BASE, version.short_string()) tag_name = "{}{}".format(BRANCH_BASE, version) for repo in hotfix_repos: util.chdir_repo(repo) create_tag_from_branch(branch_name, tag_name) util.chdir_base()
def mark_version_as_release(branch_name): util.chdir_repo('commcare-j2me') print("marking commcare-core {} branch for release".format(branch_name)) subprocess.call('git checkout {}'.format(branch_name), shell=True) subprocess.call('git pull origin {}'.format(branch_name), shell=True) replace_func(set_dev_tag_to_release, 'application/build.properties') commit_message = "Automated: removing 'alpha' from version" review_and_commit_changes(branch_name, commit_message) util.chdir_base()
def update_android_hotfix_version(branch): """ Update hotfix version in AndroidManifest and push hotfix branch. """ util.chdir_repo('commcare-android') subprocess.call('git checkout {}'.format(branch), shell=True) replace_func(update_manifest_hotfix_version, 'app/AndroidManifest.xml') review_and_commit_changes(branch, 'Automated hotfix version bump') util.chdir_base()
def update_commcare_hotfix_version_numbers(branch): """ Update hotfix version in build.properties on hotfix branch """ util.chdir_repo('commcare-core') subprocess.call('git checkout {}'.format(branch), shell=True) replace_func(incr_build_prop_hotfix_version, 'application/build.properties') review_and_commit_changes(branch, 'Automated hotfix version bump') util.chdir_base()
def close_branches(branch_name): if not util.branch_exists_in_repos(branch_name, REPOS): raise Exception("{} branch doesn't exists".format(branch_name)) print("removing local instances of the {} branch".format(branch_name)) print("You will also want to close the remote github branches") print("\tthis'll be automated once the script's been working for a while.") for repo in REPOS: util.chdir_repo(repo) print("removing {} branch of {} repo".format(branch_name, repo)) subprocess.call('git checkout master', shell=True) subprocess.call('git branch -d {}'.format(branch_name), shell=True) util.chdir_base()
def add_hotfix_version_to_android(branch_name, hotfix_count): util.chdir_repo('commcare-android') print("add hotfix ver. to commcare-android branch {}".format(branch_name)) subprocess.call('git checkout {}'.format(branch_name), shell=True) subprocess.call('git pull origin {}'.format(branch_name), shell=True) replace_func(set_hotfix_version_to_zero, 'app/AndroidManifest.xml') commit_message = 'Automated: adding hotfix version to AndroidManifest' review_and_commit_changes(branch_name, commit_message) util.chdir_base()
def update_android_version_numbers(): """ Update version numbers in AndroidManifest and push master. """ util.chdir_repo('commcare-android') subprocess.call('git checkout master', shell=True) replace_func(update_manifest_version, 'app/AndroidManifest.xml') update_resource_string_version() review_and_commit_changes('master', 'Automated version bump') util.chdir_base()
def update_commcare_version_numbers(): """ Update version numbers in build.properties and CommCareConfigEngin on master. """ util.chdir_repo('commcare-core') subprocess.call('git checkout master', shell=True) replace_func( replace_config_engine_version, 'src/cli/java/org/commcare/util/engine/CommCareConfigEngine.java') review_and_commit_changes('master', 'Automated version bump') util.chdir_base()
def update_commcare_version_numbers(): """ Update version numbers in build.properties and CommCareConfigEngin on master. """ util.chdir_repo('commcare-core') subprocess.call('git checkout master', shell=True) replace_func(replace_config_engine_version, 'util/src/org/commcare/util/engine/CommCareConfigEngine.java') review_and_commit_changes('master', 'Automated version bump') util.chdir_base()
def create_branch(repo, branch_name): util.chdir_repo(repo) subprocess.call('git checkout -b {}'.format(branch_name), shell=True) subprocess.call('git push origin {}'.format(branch_name), shell=True) util.chdir_base()
def checkout_master(repo): util.chdir_repo(repo) subprocess.call('git checkout master', shell=True) util.chdir_base()