forked from bdenne2/ps1auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
28 lines (22 loc) · 990 Bytes
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from fabric.api import *
from cuisine import *
env.use_ssh_config = True
def staging():
env.root = '/srv/http/arbitrarion.com/app/'
env.hosts = ['ps1auth-staging']
env.mode = 'staging'
env.restart = lambda : run('killall /srv/http/arbitrarion.com/venv/bin/python3', warn_only=True)
def production():
env.root = '/srv/http/members.pumpingstationone.org/app'
env.hosts = ['ps1auth-production']
env.mode = 'production'
env.restart = lambda : run('killall /srv/http/members.pumpingstationone.org/venv/bin/python3', warn_only=True)
def deploy():
with cd('%(root)s' % env):
run('git pull')
with prefix('source ~/config.sh'):
run('../venv/bin/pip install -r requirements/%(mode)s.txt' % env)
run('../venv/bin/python ./manage.py syncdb --noinput')
run('../venv/bin/python ./manage.py migrate --noinput')
run('../venv/bin/python ./manage.py collectstatic --noinput')
env.restart()