This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mailman2-api-minimal/fabfile.py
T
2017-08-01 14:29:52 +02:00

24 lines
691 B
Python

from contextlib import contextmanager as _contextmanager
from fabric.api import run, sudo, env, cd, prefix
env.use_ssh_config = True
env.hosts = ['lynx.neuf.no']
env.project_path = '/var/www/neuf.no/mailman2-api-minimal'
env.user = 'gitdeploy'
env.activate = 'source {}/venv/bin/activate'.format(env.project_path)
@_contextmanager
def virtualenv():
with cd(env.project_path), prefix(env.activate):
yield
def deploy():
with virtualenv():
run('git pull') # Get source
run('pip install -r requirements.txt') # install deps in virtualenv
# Reload mxapi.neuf.no
sudo('/usr/bin/supervisorctl pid mailman-api.neuf.no | xargs kill -HUP', shell=False)