Exemplo n.º 1
0
def run(website_id):
    (domain, use_https, db_password, files_password,
     version) = get_website_info(website_id)

    compose.install(website_id, domain, use_https, db_password, files_password,
                    version)
    nginx.install(website_id, domain, use_https)
Exemplo n.º 2
0
def install(nexus_username=defaults.nexus_user,
            download_url=defaults.download_url,
            install_dir=defaults.install_dir,
            migrate_from=None,
            install_jdk=True,
            install_nginx=True):

    # need java to run nexus
    open_jdk.install()

    # if nexus is already running, stop it
    stop_nexus()

    # create nexus user
    execute(create_user, username=nexus_username, home_dir=install_dir)

    # format a string from today's date
    today = datetime.datetime.now().strftime("%m-%d-%y")

    # setup the install options
    install_options = {
        'zip_file': today + "-" + os.path.basename(download_url),
        'download_url': download_url,
        'working_dir': "working",
        'nexus_current_dir_name': 'nexus-current',
        'nexus_old_dir_name': 'nexus-old-' + today,
        'migrate_from': migrate_from,
        'sym_linked_nexus_dir': '/usr/local/nexus'
    }

    # get the pakage to install
    install_options['created_dir'] = download_and_extract(
        install_dir, install_options)

    # backup any existing install files
    backup_existing_install(install_dir, install_options)

    # setup/install the downloaded version
    setup_downloaded_version(install_dir, install_options)

    # migrate previous install config / packages
    migrate_previous_install(install_dir, install_options, migrate_from)

    # make sure the startup script is in place
    setup_startup_script(install_dir,
                         install_options['nexus_current_dir_name'],
                         install_options['sym_linked_nexus_dir'],
                         nexus_username)

    # make sure the nexus user owns everything in the install directory
    update_ownership(nexus_username, install_dir)

    # start the nexus service
    start_nexus()

    # cleanup working dir
    with settings(warn_only=True):
        sudo('rm -rf ' + install_dir + '/' + install_options['working_dir'])

    nginx.install()
Exemplo n.º 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')
    # 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()
def install(nexus_username=defaults.nexus_user,
             download_url=defaults.download_url,
             install_dir=defaults.install_dir,
             migrate_from=None,
             install_jdk=True,
             install_nginx=True):

    # need java to run nexus
    open_jdk.install()

    # if nexus is already running, stop it
    stop_nexus()

    # create nexus user
    execute(create_user, username=nexus_username, home_dir=install_dir)

    # format a string from today's date
    today = datetime.datetime.now().strftime("%m-%d-%y")

    # setup the install options
    install_options = {
        'zip_file': today + "-" + os.path.basename(download_url),
        'download_url': download_url,
        'working_dir': "working",
        'nexus_current_dir_name': 'nexus-current',
        'nexus_old_dir_name': 'nexus-old-' + today,
        'migrate_from': migrate_from,
        'sym_linked_nexus_dir': '/usr/local/nexus'
    }

    # get the pakage to install
    install_options['created_dir'] = download_and_extract(install_dir, install_options)

    # backup any existing install files
    backup_existing_install(install_dir, install_options)

    # setup/install the downloaded version
    setup_downloaded_version(install_dir, install_options)

    # migrate previous install config / packages
    migrate_previous_install(install_dir, install_options, migrate_from)

    # make sure the startup script is in place
    setup_startup_script(install_dir,
                         install_options['nexus_current_dir_name'],
                         install_options['sym_linked_nexus_dir'],
                         nexus_username)

    # make sure the nexus user owns everything in the install directory
    update_ownership(nexus_username, install_dir)

    # start the nexus service
    start_nexus()

    # cleanup working dir
    with settings(warn_only=True):
        sudo('rm -rf ' + install_dir + '/' + install_options['working_dir'])

    nginx.install()
Exemplo n.º 5
0
def run(website_id):
    (domain, use_https, db_password, files_password, version) = get_website_info(website_id)

    zfs.create_website_dataset(website_id)

    compose.install(website_id, domain, use_https, db_password, files_password, version)
    nginx.install(website_id, domain, use_https)
    ftp.add_account(website_id, files_password)
Exemplo n.º 6
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()
Exemplo n.º 7
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()