Ejemplo n.º 1
0
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()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
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()
Ejemplo n.º 4
0
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()
Ejemplo n.º 5
0
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()
Ejemplo n.º 6
0
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()
Ejemplo n.º 7
0
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()
Ejemplo n.º 8
0
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()
Ejemplo n.º 9
0
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()
Ejemplo n.º 10
0
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()
Ejemplo n.º 11
0
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()
Ejemplo n.º 12
0
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()
Ejemplo n.º 13
0
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()
Ejemplo n.º 14
0
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()
Ejemplo n.º 15
0
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()
Ejemplo n.º 16
0
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()
Ejemplo n.º 17
0
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()
Ejemplo n.º 18
0
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()
Ejemplo n.º 19
0
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()
Ejemplo n.º 20
0
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()
Ejemplo n.º 21
0
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()
Ejemplo n.º 22
0
def checkout_master(repo):
        util.chdir_repo(repo)
        subprocess.call('git checkout master', shell=True)
        util.chdir_base()
Ejemplo n.º 23
0
def checkout_master(repo):
    util.chdir_repo(repo)
    subprocess.call('git checkout master', shell=True)
    util.chdir_base()
Ejemplo n.º 24
0
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()