1 from fabric.api import *
4 env.hosts = ['agave5.man.poznan.pl']
7 #################################################
8 # server management (remote)
9 #################################################
11 PID_FILE = '/var/run/uwsgi.pid'
16 with cd('qcg-portal'):
17 run("uwsgi --ini uwsgi.ini")
22 run("uwsgi --stop " + PID_FILE)
27 run("uwsgi --reload " + PID_FILE)
31 with settings(hide('everything'), warn_only=True):
32 return not run("ps -p `cat {}`".format(PID_FILE), shell_escape=False).failed
38 print "running." if is_running() else "not running."
41 #################################################
43 #################################################
47 with cd('qcg-portal'):
53 with cd('qcg-portal'):
56 run("pip install -r requirements.txt")
57 run("python manage.py migrate")
58 run("python manage.py collectstatic --noinput")
63 print '!!! SERVER NOT RUNNING !!!'