Skip to content

Instantly share code, notes, and snippets.

@pztrick
Created June 5, 2013 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pztrick/5713866 to your computer and use it in GitHub Desktop.
Save pztrick/5713866 to your computer and use it in GitHub Desktop.
Fabfile excerpt for SO #16929264
@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