Fixy fix deploy

This commit is contained in:
Nikolai R Kristiansen committed 2018-03-17 12:35:58 +01:00
1 parent 577164907b
commit 1c7829a774
1 file changed
+4 -11
Vendored
+4 -11
View File
@@ -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)