<commit_before># -*- coding: utf-8 -*-

from contextlib import nested

from fabric.api import *


def prepare_project():
    u"""
    Enters the directory and sources environment configuration.

    I know ``nested`` is deprecated, but what a nice shortcut it is here ;)
    """
    return nested(
        cd(PROJECT_PATH),
        prefix("source ../bin/activate"),
        prefix("source ./variablestars/.environment")
    )


PROJECT_PATH = "$HOME/v/variablestars.net/variablestars.net"

env.roledefs = {
    'web': ["<EMAIL>"],
}
env.color = True


@task
def git_push():
    local("git push origin master")


@task
@roles("web")
def git_pull():
    with cd(PROJECT_PATH):
        run("git pull origin master")


@task
@roles("web")
def update_requirements():
    with prepare_project():
        run("pip install -r requirements.txt")


@task
@roles("web")
def migrate():
    with prepare_project():
        run("python manage.py syncdb")
        #run("python manage.py migrate")


@task
@roles("web")
def collect_static():
    with prepare_project():
        run("python manage.py collectstatic --noinput")


@task
@roles("web")
def restart():
    run("appctl restart variablestars.net")


@task
@roles("web")
def deploy():
    git_push()
    git_pull()<commit_msg>Enabled migrations in deploy script.<commit_after># -*- coding: utf-8 -*-

from contextlib import nested

from fabric.api import *


def prepare_project():
    u"""
    Enters the directory and sources environment configuration.

    I know ``nested`` is deprecated, but what a nice shortcut it is here ;)
    """
    return nested(
        cd(PROJECT_PATH),
        prefix("source ../bin/activate"),
        prefix("source ./variablestars/.environment")
    )


PROJECT_PATH = "$HOME/v/variablestars.net/variablestars.net"

env.roledefs = {
    'web': ["<EMAIL>"],
}
env.color = True


@task
def git_push():
    local("git push origin master")


@task
@roles("web")
def git_pull():
    with cd(PROJECT_PATH):
        run("git pull origin master")


@task
@roles("web")
def update_requirements():
    with prepare_project():
        run("pip install -r requirements.txt")


@task
@roles("web")
def migrate():
    with prepare_project():
        run("python manage.py syncdb")
        run("python manage.py migrate")


@task
@roles("web")
def collect_static():
    with prepare_project():
        run("python manage.py collectstatic --noinput")


@task
@roles("web")
def restart():
    run("appctl restart variablestars.net")


@task
@roles("web")
def deploy():
    git_push()
    git_pull()
{'fraction_non_alphanumeric': 0.14777169663799844, 'fraction_numerical': 0.0007818608287724785, 'mean_word_length': 3.2936241610738257, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1712765', 'n_tokens_mistral': 838, 'n_tokens_neox': 804, 'n_words': 221}