Esempio n. 1
0
def push(*args, **kwargs):
    allowed_args = set(
        ['notest', 'syncdb', 'migrate', 'pip_update', 'norestart'])
    for arg in args:
        if arg not in allowed_args:
            puts('Invalid argument: %s' % arg)
            puts('Valid arguments are: %s' % allowed_args)
            return

    vcs.push()
    delete_pyc()
    with cd('src/' + env.conf['INSTANCE_NAME']):
        vcs.up()

    if 'pip_update' in args:
        pip_update(restart=False)
    if 'syncdb' in args:
        dj_cmd.syncdb()
    if 'migrate' in args:
        dj_cmd.migrate()

    dj_cmd.collectstatic()
    dj_cmd.manage('compress')

    # execute 'before_restart' callback
    kwargs.get('before_restart', lambda: None)()

    if 'norestart' not in args:
        uwsgi.uwsgi_reload()
        celery.celery_restart()
def push(*args, **kwargs):
    allowed_args = set(['notest', 'syncdb', 'migrate', 'pip_update', 'norestart'])
    for arg in args:
        if arg not in allowed_args:
            puts('Invalid argument: %s' % arg)
            puts('Valid arguments are: %s' % allowed_args)
            return

    vcs.push()
    delete_pyc()
    with cd('src/' + env.conf['INSTANCE_NAME']):
        vcs.up()

    if 'pip_update' in args:
        virtualenv.pip_update(restart=False)
    if 'syncdb' in args:
        dj_cmd.syncdb()
    if 'migrate' in args:
        dj_cmd.migrate()

    dj_cmd.collectstatic()
    dj_cmd.manage('compress')

    # execute 'before_restart' callback
    kwargs.get('before_restart', lambda: None)()

    if 'norestart' not in args:
        uwsgi.uwsgi_reload()
def update_django_config(restart=True):
    files.upload_template(
        utils._project_path(env.conf.REMOTE_CONFIG_TEMPLATE),
        utils._remote_project_path(env.conf.LOCAL_CONFIG),
        env.conf, True
    )
    if restart:
        uwsgi.uwsgi_reload()
Esempio n. 4
0
def update_django_config(restart=True):
    files.upload_template(utils._project_path(env.conf.REMOTE_CONFIG_TEMPLATE),
                          utils._remote_project_path(env.conf.LOCAL_CONFIG),
                          env.conf, True)
    if restart:
        uwsgi.uwsgi_reload()