<commit_before># coding: utf-8

from fabric.api import cd, env, local, run, task, sudo
from fabric.contrib.project import rsync_project

env.hosts = ('dailytweet.net')
env.user = ('dailytweet')
env.use_ssh_config = True

env.remote_project_dir = ('/home/dailytweet/daily-tweet')

@task
def deploy():
    _asset_compile()
    _rsync()
    _remote_refresh()

def _asset_compile():
    local('gulp build')

def _rsync():
    rsync_project(
        local_dir='.',
        remote_dir=env.remote_project_dir,
        exclude=(
            '.bundle',
            '.idea',
            '.sass-cache',
            '.git',
            'ansible',
            'node_modules',
            'roles',
            'daily-tweet-example.jpg',
            'fabfile.py',
            'gulpfile.js',
            'package.json',
            '.DS_Store',
            '.editorconfig'
        ),
        delete=True
    )

def _remote_refresh():
    with cd(env.remote_project_dir):<commit_msg>add exclude & refresh tasks<commit_after># coding: utf-8

from fabric.api import cd, env, local, run, task, sudo
from fabric.contrib.project import rsync_project

env.hosts = ('dailytweet.net')
env.user = ('root')
env.use_ssh_config = True

env.remote_project_dir = ('/home/dailytweet/daily-tweet')

@task
def deploy():
    _asset_compile()
    _rsync()
    _remote_refresh()

def _asset_compile():
    local('gulp build')

def _rsync():
    rsync_project(
        local_dir='.',
        remote_dir=env.remote_project_dir,
        exclude=(
            '.bundle',
            '.idea',
            '.sass-cache',
            '.git',
            'ansible',
            'node_modules',
            'roles',
            'daily-tweet-example.jpg',
            'fabfile.py',
            'gulpfile.js',
            'package.json',
            '.DS_Store',
            '.editorconfig',
            'app/logs',
            'app/cache/dev',
            'app/cache/pro_',
            'app/cache/test'
        ),
        delete=True
    )

def _remote_refresh():
    with cd(env.remote_project_dir):
        run('app/console doctrine:database:create --if-not-exists')
        run('app/console doctrine:schema:update --force')
{'fraction_non_alphanumeric': 0.13951353832033042, 'fraction_numerical': 0.0009178522257916476, 'mean_word_length': 1.945945945945946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4244218', 'n_tokens_mistral': 699, 'n_tokens_neox': 688, 'n_words': 128}