Пример #1
0
def first_deploy():
    """
    Sets up and deploys the project for the first time.
    """
    # If we're on the local machine, there's no point in cloning
    # the project, because it's already been cloned. Otherwise
    # the user couldn't run this file
    if env.run == run:
        # We're doing this to filter out the hosts that have
        # already been setup and deployed to
        with settings(warn_only=True):
            if env.run('test -d %s' % env.project).failed:
                return
        clone()

    # We don't setup nginx on development machines
    if env.run == run:
        setup_nginx()
    make_virtualenv()
    update_reqs()
    syncdb()
    collectstatic()

    # We don't start supervisor on development machines
    if env.run == run:
        start_supervisord()
Пример #2
0
def deploy():
    """
    Deploys the latest changes to the project
    """
    update_code()
    update_reqs()
    syncdb()
    collectstatic()
    restart_supervisord()