Exemplo n.º 1
0
def update_server():
    """ Updates server repository. """
    # backup database before updating
    backup_db()

    update_helper(env.server_root_dir)
    with cd(env.server_root_dir):
        with prefix('. .env/bin/activate'):
            run('pip install --requirement install/requirements.pip')
            run('yes yes | python manage.py collectstatic')
Exemplo n.º 2
0
def db_reset():
    """ Resets database. """
    print('Are you sure you want to reset the database?')
    host = prompt('Type in the host to confirm: ')
    branch = prompt('Type in the branch to confirm: ')
    if host == env.host and branch == env.branch:
        # backup database before resetting
        backup_db()
        with cd(env.server_root_dir):
            with prefix('. .env/bin/activate'):
                run('./reset.sh')
    else:
        print('Invalid host or branch.')
Exemplo n.º 3
0
def db_reset():
    """ Resets database. """
    print("Are you sure you want to reset the database?")
    host = prompt("Type in the host to confirm: ")
    branch = prompt("Type in the branch to confirm: ")
    if host == env.host and branch == env.branch:
        # backup database before resetting
        backup_db()
        with cd(env.server_root_dir):
            with prefix(". .env/bin/activate"):
                run("./reset.sh")
    else:
        print("Invalid host or branch.")