Added supervisor/gunicorn handlers on deploy script.

This commit is contained in:
Felipe Martín 2013-05-23 18:27:41 +02:00
parent d3063e861a
commit 3bac8469c0
2 changed files with 14 additions and 0 deletions

View File

@ -2,6 +2,7 @@
command = /home/app/server.sh
directory = /home/app
user = app
stopsignal = QUIT
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/gunicorn.log

View File

@ -413,6 +413,19 @@ status = call(
check_status(status)
# ================ SERVER =======================
title('Server')
sub('Killing all gunicorn_django instances')
status = call(['killall', 'gunicorn_django'],
stdout=open(os.devnull, 'wb'),
stderr=open(os.devnull, 'wb'))
check_status(status)
sub('Restarting with supervisor')
status = call(['sudo', 'supervisorctl', 'restart', 'gunicorn'],
stdout=open(os.devnull, 'wb'),
stderr=open(os.devnull, 'wb'))
check_status(status)
print("")
success('Finished!')