Created
June 5, 2013 13:33
-
-
Save pztrick/5713866 to your computer and use it in GitHub Desktop.
Fabfile excerpt for SO #16929264
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@roles('broker', 'stressors') | |
def git_pull(): | |
with cd("%s" % git_folder): | |
run("git pull") | |
@roles('stressors') | |
def restart_celeryd(): | |
# NOT WORKING | |
sudo("supervisorctl restart all") | |
#sudo("supervisorctl restart celeryd") | |
@roles('stressors') | |
def kill_celeryd(): | |
# NOT WORKING | |
sudo("ps auxww | grep celeryd | grep -v grep | awk '{print $2}' | xargs kill -HUP") | |
def reload_worker_modules(): | |
# NOT WORKING | |
from celeryd.tasks import celery | |
celery.control.broadcast('pool_restart', arguments={'reload': True}) | |
@task | |
def pull(): | |
""" Pull git repos """ | |
execute(git_pull) | |
execute(reboot_stressors) | |
#execute(restart_celeryd) | |
#execute(kill_celeryd) | |
#reload_worker_modules() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment