예제 #1
0
def deploy():
    """Deploy the project: fab [environment] deploy"""
    push()
    with cd(env.path):
        run('git pull {push_remote} {push_branch}'.format(**env))
        with _venv(env.virtualenv_path):
            run('pip install -Ur {requirements}'.format(**env))
        migrate()
        with _venv(env.virtualenv_path):
            run('./manage.py collectstatic --noinput {settings}'.format(**env))
            # run('./manage.py compilemessages %(settings)s'.format(**env))
    restart()
예제 #2
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def deploy():
    """Deploy the project: fab [environment] deploy"""
    push()
    with cd(env.path):
        run('git pull {push_remote} {push_branch}'.format(**env))
        with _venv(env.virtualenv_path):
            run('pip install -Ur {requirements}'.format(**env))
        migrate()
        with _venv(env.virtualenv_path):
            run('./manage.py collectstatic --noinput {settings}'.format(**env))
            # run('./manage.py compilemessages %(settings)s'.format(**env))
    restart()
예제 #3
0
파일: fabfile.py 프로젝트: swoopyy/colegend
def run_command(command):
    """
    Run a management command: fab [environment] run_command my_command
    Example: fab production run_command:'./manage.py check'
    """
    with cd(env.path):
        with _venv(env.virtualenv_path):
            run('{command} {settings}'.format(command=command, settings=env.settings))
예제 #4
0
def show_crontab():
    """Show the current crontab entries: fab [environment] show_crontab"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py crontab show {settings}'.format(**env))
예제 #5
0
def create_superuser():
    """Create a django superuser: fab [environment] create_superuser"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py createsuperuser {settings}'.format(**env))
예제 #6
0
def shell():
    """Open a shell: fab [environment] shell"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py shell_plus {settings}'.format(**env))
예제 #7
0
def disable_debug():
    """Disable django debug mode: fab [environment] disable_debug"""
    with _venv(env.virtualenv_path):
        run("sed -i -e 's/DJANGO_DEBUG=True/DJANGO_DEBUG=False/' {path}/.env".
            format(**env))
    restart()
예제 #8
0
def migrate():
    """Migrate the database: fab [environment] migrate"""
    with _venv(env.virtualenv_path):
        run("{path}/manage.py migrate {settings}".format(**env))
예제 #9
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def remove_crontab():
    """Remove the crontab entries: fab [environment] remove_crontab"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py crontab remove {settings}'.format(**env))
예제 #10
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def add_crontab():
    """Update the crontab entries: fab [environment] add_crontab"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py crontab add {settings}'.format(**env))
예제 #11
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def show_crontab():
    """Show the current crontab entries: fab [environment] show_crontab"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py crontab show {settings}'.format(**env))
예제 #12
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def create_superuser():
    """Create a django superuser: fab [environment] create_superuser"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py createsuperuser {settings}'.format(**env))
예제 #13
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def shell():
    """Open a shell: fab [environment] shell"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py shell_plus {settings}'.format(**env))
예제 #14
0
def add_crontab():
    """Update the crontab entries: fab [environment] add_crontab"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py crontab add {settings}'.format(**env))
예제 #15
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def migrate():
    """Migrate the database: fab [environment] migrate"""
    with _venv(env.virtualenv_path):
        run("{path}/manage.py migrate {settings}".format(**env))
예제 #16
0
def remove_crontab():
    """Remove the crontab entries: fab [environment] remove_crontab"""
    with _venv(env.virtualenv_path):
        run('{path}/manage.py crontab remove {settings}'.format(**env))
예제 #17
0
파일: fabfile.py 프로젝트: Eraldo/colegend
def disable_debug():
    """Disable django debug mode: fab [environment] disable_debug"""
    with _venv(env.virtualenv_path):
        run("sed -i -e 's/DJANGO_DEBUG=True/DJANGO_DEBUG=False/' {path}/.env".format(**env))
    restart()