コード例 #1
0
def check_branch():
    git = Git()
    if git.get_current_branch() not in BRANCHES_SUPPORTED_FOR_TAG:
        accepted_branches = ', '.join(BRANCHES_SUPPORTED_FOR_TAG)
        print("Tagging is only supported on {} "
              "you should not tag any other branch, exiting!".format(accepted_branches))
        raise SystemExit(1)
コード例 #2
0
def push():
    git = Git()
    current_version = open('.VERSION', 'r').read()
    git.commit('Set version to {}'.format(current_version), '.VERSION')
    git.tag(current_version)
    git.push()
    git.push('origin', current_version)
コード例 #3
0
ファイル: tag.py プロジェクト: yutanicorp/python_project
def create_patch(old_version, new_version):
    git = Git()
    patch = git.create_patch(old_version, new_version)
    patch = filter_patch(patch)
    patch_file = os.path.join('{{cookiecutter.project_slug}}', '_CI',
                              'patches', f'{new_version}.patch')
    with open(patch_file, 'w') as ofile:
        ofile.write(patch)
    return patch_file
コード例 #4
0
ファイル: tag.py プロジェクト: rtoma/prereceivecli
def push(current_version):
    git = Git()
    git.commit('Updated history file with changelog', 'HISTORY.rst')
    git.commit('Set version to {}'.format(current_version), '.VERSION')
    git.add_tag(current_version)
    git.push()
    git.push('origin', current_version)
    return current_version
コード例 #5
0
def push(current_version):
    git = Git()
    git.commit('Add commit to history file', 'HISTORY.rst')
    git.commit('Set version to {}'.format(current_version), '.VERSION')
    git.add_tag(current_version)
    git.push()
    git.push('origin', current_version)
    return current_version
コード例 #6
0
ファイル: tag.py プロジェクト: yutanicorp/python_project
def commit_patch_and_push(segment, current_version, version_file_path):
    git = Git()
    new_version = bump(segment, version_file_path)
    print(f'Commiting version {new_version}')
    git.commit(f'Set version to {new_version}', version_file_path)
    print(f'Tagging version {new_version}')
    git.add_tag(new_version)
    print(
        f'Creating patch between version {current_version} and {new_version}')
    patch_file = create_patch(current_version, new_version)
    print(f'Adding file {patch_file} to git tracking')
    git.add(patch_file)
    print(f'Commiting {patch_file}')
    git.commit(f'Adding patch file for version "{new_version}"', patch_file)
    print('Pushing everything')
    git.push()
    print(f'Pushing tag {new_version}')
    git.push('origin', new_version)
    return new_version