diff --git a/fabfile.py b/fabfile.py index 3a8d010..ca7a805 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1,5 +1,4 @@ -from contextlib import contextmanager -from fabric.api import run, sudo, env, cd, prefix +from fabric.api import run, sudo, env, cd env.use_ssh_config = True env.hosts = ['dreamcast.neuf.no'] @@ -7,18 +6,12 @@ env.project_path = '/var/www/neuf.no/infoskjerm2' env.user = 'gitdeploy' -@contextmanager -def virtualenv(): - with cd(env.project_path), prefix('pipenv shell'): - yield - - def deploy(): - with virtualenv(): + with cd(env.project_path): run('git pull') # Get source run('pipenv install') # install deps in virtualenv - run('umask 022; python manage.py collectstatic --noinput') # Collect static - run('python manage.py migrate') # Run DB migrations + run('umask 022; pipenv run python manage.py collectstatic --noinput') # Collect static + run('pipenv run python manage.py migrate') # Run DB migrations # Reload sudo('/usr/bin/supervisorctl pid infoskjerm.neuf.no | xargs kill -HUP', shell=False)