Ejemplo n.º 1
0
def pip_requirements():
    """
    Usage: `fab -R all deploy.pip_requirements`. Install the required python packages from the requirements.txt file using pip
    """
    result = None
    if not env.get('release'):
        manage_release(disable_newrelic=True)

    if not chkvirtualenv():
        mkvirtualenv()

    with prefix(env.activate):
        pip_package_preinstall()
        result = run('pip install -r %(path)s/releases/%(release)s/requirements.txt' % env)

    if not result:
        print(red("pip install failed. Please manually debug the dependencies and compilation problem."))
        exit()
Ejemplo n.º 2
0
def deploy(email=False):
    """
    Usage: `fab -R all deploy` or fab -H mysite.com deploy`. Execute a deployment to the given groups of hosts or host
    """
    if not chk_req():
        return

    if git_branch_check() or test_host_check():
        manage_release('Deployment start')
        git_archive_and_upload_tar()
        pip_requirements()
        collectstatic(deploy=True)
        # TODO:
        # automatically run migration; once successful,
        # conclude the deployment with symlink_current()
        symlink_current()
        webserver()
        # post-deployment tasks
        manage_release('Deployment start')
        _releases_cleanup()
        email_on_success(trigger=email)
Ejemplo n.º 3
0
def deploy(email=False):
    """
    Usage: `fab -R all deploy` or fab -H mysite.com deploy`. Execute a deployment to the given groups of hosts or host
    """
    if not chk_req():
        return

    if git_branch_check() or test_host_check():
        manage_release('Deployment start')
        git_archive_and_upload_tar()
        pip_requirements()
        collectstatic(deploy=True)
        # TODO:
        # automatically run migration; once successful,
        # conclude the deployment with symlink_current()
        symlink_current()
        webserver()
        # post-deployment tasks
        manage_release('Deployment start')
        _releases_cleanup()
        email_on_success(trigger=email)
Ejemplo n.º 4
0
def pip_requirements():
    """
    Usage: `fab -R all deploy.pip_requirements`. Install the required python packages from the requirements.txt file using pip
    """
    result = None
    if not env.get('release'):
        manage_release(disable_newrelic=True)

    if not chkvirtualenv():
        mkvirtualenv()

    with prefix(env.activate):
        pip_package_preinstall()
        result = run(
            'pip install -r %(path)s/releases/%(release)s/requirements.txt' %
            env)

    if not result:
        print(
            red("pip install failed. Please manually debug the dependencies and compilation problem."
                ))
        exit()