Beispiel #1
0
def initial_deploy():
    """ Performs a complete deploy of the project. """

    # put ssh key
    set_deploy_key()

    # github host handshake
    run('ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts')
    # bitbucket host handshake
    run('ssh-keyscan -t rsa bitbucket.org >> ~/.ssh/known_hosts')

    # install necessary dependencies to handle the project
    install_project_handling_dependencies()

    # clone repository
    git_clone(env.server_git_url, env.server_root_dir)

    # checkout branch
    with cd(env.server_root_dir):
        git_checkout(env.branch)

    # dependencies installation (quickstart)
    with cd(env.server_root_dir):
        run('./quickstart.sh')

    # gunicorn installation and configuration
    gunicorn.install()
    gunicorn.add_gunicorn_service()
    gunicorn.start()

    # nginx installation and configuration
    nginx.install()
    nginx.add_django_site()
    nginx.start()
Beispiel #2
0
def git_perform_analysis(start, finish, path):
    import os
    # get list of files in start commit
    utils.git_checkout(path, start)
    start_files_funcs = {}
    # r=root, d=directories, f = files
    for r, d, f in os.walk(path):
        for file in f:
            if '.cpp' in file or '.h' in file:
                start_files_funcs.update({
                    os.path.join(r, file):
                    structparser.get_cpp_funcs(os.path.join(r, file))
                })
    # pprint.pprint(start_files_funcs.keys())
    # get list of files in start commit
    utils.git_checkout(path, finish)
    finish_files_funcs = {}
    # r=root, d=directories, f = files
    for r, d, f in os.walk(path):
        for file in f:
            if '.cpp' in file or '.h' in file:
                finish_files_funcs.update({
                    os.path.join(r, file):
                    structparser.get_cpp_funcs(os.path.join(r, file))
                })
    # get list of new files
    new_files_list = []
    for key in finish_files_funcs.keys():
        if key not in start_files_funcs.keys():
            new_files_list.append(key)
    # pprint.pprint(finish_files_funcs.keys())
    # pprint.pprint(new_files_list)

    # determine test scope
    test_scope = {}
    hunks = get_hunks_in_commits(start, finish)
    for file_path in finish_files_funcs:
        if file_path not in start_files_funcs.keys():
            test_scope.update({file_path: set(finish_files_funcs[file_path])})
        else:
            for func in finish_files_funcs[file_path]:
                if func in start_files_funcs[file_path]:
                    file_name = file_path.split('/')[-1]
                    if file_name not in hunks:
                        continue
                    for diff in hunks[file_name]:
                        if func in diff.header:
                            test_scope = add_to_test_scope(
                                test_scope, file_path, func)
                else:
                    test_scope = add_to_test_scope(test_scope, file_path, func)
    return test_scope
Beispiel #3
0
def initial_deploy():
    """ Performs a complete deploy of the project. """

    # put ssh key
    set_deploy_key()

    # github host handshake
    run('ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts')

    # install necessary dependencies to handle the project
    install_project_handling_dependencies()

    # clone repository
    git_clone(env.server_git_url, env.server_root_dir)

    # checkout branch
    with cd(env.server_root_dir):
        git_checkout(env.branch)

    # mysql installation
    install_mysql()

    # dependencies installation (quickstart)
    with cd(env.server_root_dir):
        run('./quickstart.sh')

    # bower installation
    bower.install()

    # gunicorn installation and configuration
    gunicorn.install()
    gunicorn.add_gunicorn_service()
    gunicorn.start()

    # nginx installation and configuration
    nginx.install()
    nginx.add_django_site()
    nginx.start()
Beispiel #4
0
def initial_deploy():
    """ Performs a complete deploy of the project. """

    # put ssh key
    ssh_key = '%s/fabfile/templates/ssh_key'
    ssh_key %= env.local_root_dir
    run('mkdir -p -m 0700 .ssh')
    put(ssh_key, '.ssh/id_rsa', mode=0600)

    # github host handshake
    run('ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts')

    # clone repository
    deb_handler.install('git')
    git_clone(env.server_git_url, env.server_root_dir)

    # checkout branch
    with cd(env.server_root_dir):
        git_checkout(env.branch)

    # mysql installation
    install_mysql()

    # dependencies installation (quickstart)
    with cd(env.server_root_dir):
        run('./quickstart.sh')

    # gunicorn installation and configuration
    gunicorn.install()
    gunicorn.add_gunicorn_service()
    gunicorn.start()

    # nginx installation and configuration
    nginx.install()
    nginx.add_django_site()
    nginx.start()