Example #1
0
def run_default(args):
    global gitflow
    gitflow = GitFlow()
    gitflow._enforce_git_repo()
    gitflow._enforce_services()

    if gitflow.is_initialized():
        if not args.force:
            raise AlreadyInitialized()

    if args.use_defaults:
        warn("Using default branch names.")

    _ask_name(args, "origin", "Remote name to use as origin in git flow")
 
    # Make sure that origin uses SSH protocol for communication,
    # otherwise Review Board is going to fail.
    _ensure_SSH()

    #-- add a master branch if no such branch exists yet
    if gitflow.has_master_configured() and not args.force:
        master_branch = gitflow.master_name()
    else:
        master_branch = _ask_branch(args,
            'master',
            'bringing forth production releases',
            'production releases',
            ['production', 'main', 'master'])

    #-- add a develop branch if no such branch exists yet
    if gitflow.has_develop_configured() and not args.force:
        develop_branch = gitflow.develop_name()
    else:
        develop_branch = _ask_branch(args,
            'develop',
            'integration of the "next release"',
            '"next release" development',
            ['develop', 'int', 'integration', 'master'],
            filter=[master_branch])

    if not gitflow.is_initialized() or args.force:
        print
        print "How to name your supporting branch prefixes?"

    _ask_prefix(args, "feature", "Feature branches")
    _ask_prefix(args, "release", "Release branches")
    _ask_prefix(args, "hotfix", "Hotfix branches")
    _ask_prefix(args, "support", "Support branches")
    _ask_prefix(args, "versiontag", "Version tag prefix")

    _ask_name(args, 'release.versionmatcher',
            'Regular expression for matching release numbers')

    _ask_pt_projid()
    _ask_rb_repoid()

    # assert the gitflow repo has been correctly initialized
    assert gitflow.is_initialized()

    gitflow.init(master_branch, develop_branch)
Example #2
0
def run_default(args):
    global gitflow
    gitflow = GitFlow()
    gitflow._enforce_git_repo()

    if gitflow.is_initialized():
        if not args.force:
            raise AlreadyInitialized()

    if args.use_defaults:
        warn("Using default branch names.")

    _ask_name(args, "origin", "Remote name to use as origin in git flow")

    # -- add a master branch if no such branch exists yet
    if gitflow.has_master_configured() and not args.force:
        master_branch = gitflow.master_name()
    else:
        master_branch = _ask_branch(
            args,
            'master',
            'bringing forth production releases',
            'production releases',
            ['production', 'main', 'master'])

    # -- add a develop branch if no such branch exists yet
    if gitflow.has_develop_configured() and not args.force:
        develop_branch = gitflow.develop_name()
    else:
        develop_branch = _ask_branch(
            args,
            'develop',
            'integration of the "next release"',
            '"next release" development',
            ['develop', 'int', 'integration', 'master'],
            filter=[master_branch])

    if not gitflow.is_initialized() or args.force:
        print("How to name your supporting branch prefixes?")

    _ask_prefix(args, "feature", "Feature branches")
    _ask_prefix(args, "release", "Release branches")
    _ask_prefix(args, "hotfix", "Hotfix branches")
    _ask_prefix(args, "support", "Support branches")
    _ask_prefix(args, "versiontag", "Version tag prefix")

    # assert the gitflow repo has been correctly initialized
    assert gitflow.is_initialized()

    gitflow.init(master_branch, develop_branch)
Example #3
0
def run_default(args):
    global gitflow
    gitflow = GitFlow()
    gitflow._enforce_git_repo()

    if gitflow.is_initialized():
        if not args.force:
            raise AlreadyInitialized()

    if args.use_defaults:
        warn("Using default branch names.")

    _ask_name(args, "origin", "Remote name to use as origin in git flow")

    #-- add a master branch if no such branch exists yet
    if gitflow.has_master_configured() and not args.force:
        master_branch = gitflow.master_name()
    else:
        master_branch = _ask_branch(args, 'master',
                                    'bringing forth production releases',
                                    'production releases',
                                    ['production', 'main', 'master'])

    #-- add a develop branch if no such branch exists yet
    if gitflow.has_develop_configured() and not args.force:
        develop_branch = gitflow.develop_name()
    else:
        develop_branch = _ask_branch(
            args,
            'develop',
            'integration of the "next release"',
            '"next release" development',
            ['develop', 'int', 'integration', 'master'],
            filter=[master_branch])

    if not gitflow.is_initialized() or args.force:
        print
        print "How to name your supporting branch prefixes?"

    _ask_prefix(args, "feature", "Feature branches")
    _ask_prefix(args, "release", "Release branches")
    _ask_prefix(args, "hotfix", "Hotfix branches")
    _ask_prefix(args, "support", "Support branches")
    _ask_prefix(args, "versiontag", "Version tag prefix")

    # assert the gitflow repo has been correctly initialized
    assert gitflow.is_initialized()

    gitflow.init(master_branch, develop_branch)
Example #4
0
def run_default(args):
    global gitflow
    gitflow = GitFlow()
    gitflow._enforce_git_repo()
    gitflow._enforce_services()

    if gitflow.is_initialized():
        if not args.force:
            raise AlreadyInitialized()

    if args.use_defaults:
        warn("Using default branch names.")

    _ask_name(args, "origin", "Remote name to use as origin in git flow")

    # Make sure that origin uses SSH protocol for communication,
    # otherwise Review Board is going to fail.
    _ensure_SSH()

    #-- add a master branch if no such branch exists yet
    if gitflow.has_master_configured() and not args.force:
        master_branch = gitflow.master_name()
    else:
        master_branch = _ask_branch(args, 'master',
                                    'bringing forth production releases',
                                    'production releases',
                                    ['production', 'main', 'master'])

    #-- add a develop branch if no such branch exists yet
    if gitflow.has_develop_configured() and not args.force:
        develop_branch = gitflow.develop_name()
    else:
        develop_branch = _ask_branch(
            args,
            'develop',
            'integration of the "next release"',
            '"next release" development',
            ['develop', 'int', 'integration', 'master'],
            filter=[master_branch])

    if not gitflow.is_initialized() or args.force:
        print
        print "How to name your supporting branch prefixes?"

    _ask_prefix(args, "feature", "Feature branches")
    _ask_prefix(args, "release", "Release branches")
    _ask_prefix(args, "hotfix", "Hotfix branches")
    _ask_prefix(args, "support", "Support branches")
    _ask_prefix(args, "versiontag", "Version tag prefix")

    _ask_name(args, 'release.versionmatcher',
              'Regular expression for matching release numbers')

    _ask_name(args, 'circleci.enabled', 'Enable Circle CI integration [Y/n]')

    _ask_name(args, 'pagination', 'Number of stories to list on one page')

    _ask_pt_projid(args.use_defaults)
    _ask_pt_labels(args.use_defaults)
    _ask_rb_repoid(args.use_defaults)

    # assert the gitflow repo has been correctly initialized
    assert gitflow.is_initialized()

    gitflow.init(master_branch, develop_branch)
Example #5
0
def run_default(args):
    global gitflow
    gitflow = GitFlow()
    gitflow._enforce_git_repo()
    gitflow._enforce_services()

    if gitflow.is_initialized():
        if not args.force:
            raise AlreadyInitialized()

    if args.use_defaults:
        warn("Using default branch names.")

    # -- ask about Circle CI
    _ask_name(args, "circleci.enabled", "Enable Circle CI integration [Y/n]")

    _ask_name(args, "origin", "Remote name to use as origin in git flow")

    # Make sure that origin uses SSH protocol for communication,
    # otherwise Review Board is going to fail.
    _ensure_SSH()

    # -- add a master branch if no such branch exists yet
    if gitflow.has_master_configured() and not args.force:
        master_branch = gitflow.master_name()
    else:
        master_branch = _ask_branch(
            args,
            "master",
            "bringing forth production releases",
            "production releases",
            ["production", "main", "master"],
        )

    # -- add a develop branch if no such branch exists yet
    if gitflow.has_develop_configured() and not args.force:
        develop_branch = gitflow.develop_name()
    else:
        develop_branch = _ask_branch(
            args,
            "develop",
            'integration of the "next release"',
            '"next release" development',
            ["develop", "int", "integration", "master"],
            filter=[master_branch],
        )

    # -- ask for the staging branch in case CircleCI is enabled.
    if gitflow.is_circleci_enabled():
        if gitflow.has_stage_configured() and not args.force:
            stage_branch = gitflow.stage_branch()
        else:
            stage_branch = _ask_branch(
                args, "stage", "release client acceptance", "release client acceptance", ["stage"]
            )

    if not gitflow.is_initialized() or args.force:
        print
        print "How to name your supporting branch prefixes?"

    _ask_prefix(args, "feature", "Feature branches")
    _ask_prefix(args, "release", "Release branches")
    _ask_prefix(args, "hotfix", "Hotfix branches")
    _ask_prefix(args, "support", "Support branches")
    _ask_prefix(args, "versiontag", "Version tag prefix")

    _ask_name(args, "release.versionmatcher", "Regular expression for matching release numbers")

    _ask_name(args, "pagination", "Number of stories to list on one page")

    _ask_pt_projid(args.use_defaults)
    _ask_pt_labels(args.use_defaults)
    _ask_rb_repoid(args.use_defaults)

    # assert the gitflow repo has been correctly initialized
    assert gitflow.is_initialized()

    gitflow.init(master_branch, develop_branch)