mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Updated fabric requirement, added more controls to the Fabfile
This commit is contained in:
39
fabfile.py
vendored
39
fabfile.py
vendored
@@ -181,6 +181,8 @@ def stop_celeryd():
|
||||
with cd('%(path)s/dreddit-auth/' % env):
|
||||
if exists('logs/celeryd.pid'):
|
||||
run('kill `cat logs/celeryd.pid`')
|
||||
time.sleep(2)
|
||||
run('rm -f logs/celeryd.pid')
|
||||
else:
|
||||
warn('celeryd isn\'t running')
|
||||
|
||||
@@ -194,35 +196,48 @@ def restart_celeryd():
|
||||
|
||||
|
||||
def start_uwsgi():
|
||||
"""
|
||||
Start uWSGI
|
||||
"""
|
||||
with cd('%(path)s/dreddit-auth/' % env):
|
||||
run('uwsgi -d logs/uwsgi.log -x etc/auth_uwsgi.xml' % env)
|
||||
|
||||
|
||||
def stop_uwsgi():
|
||||
def restart_uwsgi():
|
||||
"""
|
||||
Restart the uWSGI daemon
|
||||
"""
|
||||
with cd('%(path)s/dreddit-auth/' % env):
|
||||
if exists('logs/uwsgi.pid'):
|
||||
run('kill `cat logs/uwsgi.pid`')
|
||||
else:
|
||||
warn('uWSGI isn\'t running')
|
||||
|
||||
|
||||
def restart_uwsgi():
|
||||
stop_uwsgi()
|
||||
time.sleep(0.5)
|
||||
start_uwsgi()
|
||||
|
||||
|
||||
def start():
|
||||
"""
|
||||
Start uWSGI and Celery
|
||||
"""
|
||||
start_uwsgi()
|
||||
start_celeryd()
|
||||
|
||||
|
||||
def stop():
|
||||
"""
|
||||
Stop Celery
|
||||
"""
|
||||
stop_celeryd()
|
||||
stop_uwsgi()
|
||||
|
||||
info('Can\'t stop uWSGI')
|
||||
|
||||
def restart():
|
||||
stop()
|
||||
"""
|
||||
Restart uWSGI and Celery
|
||||
"""
|
||||
stop_celeryd()
|
||||
time.sleep(5)
|
||||
start()
|
||||
restart_uwsgi()
|
||||
start_celeryd()
|
||||
|
||||
def clear_logs():
|
||||
with cd('%(path)s/dreddit-auth/' % env):
|
||||
run('rm ./logs/*.log')
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ yolk==0.4.1
|
||||
-e hg+http://bitbucket.org/schinckel/django-jsonfield@acb6b4fd7312#egg=django-jsonfield
|
||||
xmlrpclib==1.0.1
|
||||
South==0.7.3
|
||||
fabric==0.9.1
|
||||
fabric==1.0.1
|
||||
flup
|
||||
django-debug-toolbar==0.8.3
|
||||
simplejson
|
||||
|
||||
Reference in New Issue
Block a user