-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabfile.py
More file actions
executable file
·26 lines (21 loc) · 839 Bytes
/
fabfile.py
File metadata and controls
executable file
·26 lines (21 loc) · 839 Bytes
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
from fabric.api import *
from contextlib import contextmanager
env.user = "bookinguser"
env.hosts = ["accel-propusk.iidf.ru"]
env.key_filename = ["/Users/korneevm/.ssh/korneevm"]
env.homedir = "/home/bookinguser"
env.project = "/home/bookinguser/project"
env.reload = "%s/docroot/reload.txt" % env.homedir
@contextmanager
def virtualenv():
with cd(env.homedir):
with prefix('source /home/bookinguser/.virtualenvs/env/bin/activate'):
yield
def deploy():
with virtualenv():
with cd(env.project):
run('git pull')
run('pip install -q -r ./config/requirements.txt')
run('envdir %s/envdir/ python manage.py migrate' % env.homedir)
run('envdir %s/envdir/ python manage.py collectstatic -v0 --noinput' % env.homedir)
run('touch %s' % env.reload)