mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +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):
|
with cd('%(path)s/dreddit-auth/' % env):
|
||||||
if exists('logs/celeryd.pid'):
|
if exists('logs/celeryd.pid'):
|
||||||
run('kill `cat logs/celeryd.pid`')
|
run('kill `cat logs/celeryd.pid`')
|
||||||
|
time.sleep(2)
|
||||||
|
run('rm -f logs/celeryd.pid')
|
||||||
else:
|
else:
|
||||||
warn('celeryd isn\'t running')
|
warn('celeryd isn\'t running')
|
||||||
|
|
||||||
@@ -194,35 +196,48 @@ def restart_celeryd():
|
|||||||
|
|
||||||
|
|
||||||
def start_uwsgi():
|
def start_uwsgi():
|
||||||
|
"""
|
||||||
|
Start uWSGI
|
||||||
|
"""
|
||||||
with cd('%(path)s/dreddit-auth/' % env):
|
with cd('%(path)s/dreddit-auth/' % env):
|
||||||
run('uwsgi -d logs/uwsgi.log -x etc/auth_uwsgi.xml' % 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):
|
with cd('%(path)s/dreddit-auth/' % env):
|
||||||
if exists('logs/uwsgi.pid'):
|
if exists('logs/uwsgi.pid'):
|
||||||
run('kill `cat logs/uwsgi.pid`')
|
run('kill `cat logs/uwsgi.pid`')
|
||||||
else:
|
else:
|
||||||
warn('uWSGI isn\'t running')
|
warn('uWSGI isn\'t running')
|
||||||
|
|
||||||
|
|
||||||
def restart_uwsgi():
|
|
||||||
stop_uwsgi()
|
|
||||||
time.sleep(0.5)
|
|
||||||
start_uwsgi()
|
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
|
"""
|
||||||
|
Start uWSGI and Celery
|
||||||
|
"""
|
||||||
start_uwsgi()
|
start_uwsgi()
|
||||||
start_celeryd()
|
start_celeryd()
|
||||||
|
|
||||||
|
|
||||||
def stop():
|
def stop():
|
||||||
|
"""
|
||||||
|
Stop Celery
|
||||||
|
"""
|
||||||
stop_celeryd()
|
stop_celeryd()
|
||||||
stop_uwsgi()
|
info('Can\'t stop uWSGI')
|
||||||
|
|
||||||
|
|
||||||
def restart():
|
def restart():
|
||||||
stop()
|
"""
|
||||||
|
Restart uWSGI and Celery
|
||||||
|
"""
|
||||||
|
stop_celeryd()
|
||||||
time.sleep(5)
|
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
|
-e hg+http://bitbucket.org/schinckel/django-jsonfield@acb6b4fd7312#egg=django-jsonfield
|
||||||
xmlrpclib==1.0.1
|
xmlrpclib==1.0.1
|
||||||
South==0.7.3
|
South==0.7.3
|
||||||
fabric==0.9.1
|
fabric==1.0.1
|
||||||
flup
|
flup
|
||||||
django-debug-toolbar==0.8.3
|
django-debug-toolbar==0.8.3
|
||||||
simplejson
|
simplejson
|
||||||
|
|||||||
Reference in New Issue
Block a user