示例#1
0
def join():
    """ Join the project with the project argument name.
    """

    check_server()
    check_user()

    project = config['parser']['project']
    path = config['parser']['path']
    project_scm = _check_scm(path)

    _check_project(project)
    config['projects'][project] = {
        'path': path,
        'scm': project_scm,
        'enable': 1
    }

    print("Join in progress...")
    with AdminTransport(logger_enabled=False) as transport:
        ret_status, msg = transport.join_project(project)
        if not _on_action_finished(ret_status, msg):
            return

    dump()
示例#2
0
def create():
    """ Create a new project with the project argument name.
    """

    check_server()
    check_user()

    project = config['parser']['project']
    path = config['parser']['path']
    project_scm = _check_scm(path)

    _check_project(project)
    config['projects'][project] = {
        'path': path,
        'scm': project_scm,
        'enable': 1
    }

    print("Creation in progress...")
    with AdminTransport(logger_enabled=False) as transport:
        ret_status, msg = transport.create_project(project)
        if not _on_action_finished(ret_status, msg):
            return

    dump()

    # Do an init() if the git-url can be guessed.
    git_url = _get_git_url(path)
    if git_url:
        config['parser']['git-url'] = git_url
        init()