forked from NationalGenomicsInfrastructure/genomics-status
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile_local.py
39 lines (33 loc) · 1.1 KB
/
fabfile_local.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
32
33
34
35
36
37
38
39
"""Fabfile to locally deploy genomics-status
"""
from fabric.api import *
def stop():
""" Stops the genomics-status webapp server.
"""
local("kill $(ps aux | grep '[s]tatus_app.py' | awk '{print $2}')")
def git_pull():
""" Pulls the changes from the origin/master of the repo on the server.
"""
with lcd('/home/genomics.www/status'):
with prefix('source ~/.virtualenvs/web/bin/activate'):
local('git pull')
local('git submodule update')
def install():
""" Installs the webapp code in the virtual environemnt 'web' on the server.
"""
with lcd('/home/genomics.www/status'):
with prefix('source ~/.virtualenvs/web/bin/activate'):
local('python setup.py develop')
def start():
""" Starts the genommics-status webapp server, in a screen session.
"""
with lcd('/home/genomics.www/status/run_dir'):
with prefix('source ~/.virtualenvs/web/bin/activate'):
local('status_app.py &')
def deploy():
""" Performs all steps needed to deploy new code.
"""
stop()
git_pull()
install()
start()