-
Notifications
You must be signed in to change notification settings - Fork 1
/
fabfile.py
31 lines (27 loc) · 1.14 KB
/
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
28
29
30
31
from fabric.api import cd, env, prefix, run, sudo
"""
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!! DEPRECATED: use ansible (more in README.md) !!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
"""
env.hosts = ['billing.maxi-booking.com']
env.port = 22
env.key_filename = '~/.ssh/maxibookingltd.pem'
env.user = "ubuntu"
env.project_dir = '/home/ubuntu/python/maxibooking-billing'
env.activate = 'source /home/ubuntu/.virtualenvs/billing/bin/activate'
def deploy():
with cd(env.project_dir):
with prefix(env.activate):
run('git pull origin master')
run('pip install --upgrade pip')
run('pip install -r requirements.txt')
run('npm install')
run('./manage.py collectstatic --no-input')
run('./manage.py migrate --no-input')
run('./manage.py compilemessages')
sudo('sudo supervisorctl restart billing')
sudo('sudo supervisorctl restart billing_celery_high')
sudo('sudo supervisorctl restart billing_celery_default')
sudo('sudo supervisorctl restart billing_celery_beat')
sudo('sudo service nginx restart')