Skip to content

Instantly share code, notes, and snippets.

@mrchilds
Created December 9, 2013 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchilds/7871446 to your computer and use it in GitHub Desktop.
Save mrchilds/7871446 to your computer and use it in GitHub Desktop.
Example....
def pre_staging_restart_services():
"""
Restart celery and gunicorn services
Used by newer staging environments
"""
# Install requirements
with virtualenv():
run('pip install -r /srv/CustomMade/requirements.txt')
if 'web' in env.host:
with virtualenv():
run('/srv/CustomMade/manage.py compress')
run("sudo supervisorctl restart gunicorn")
if 'util' in env.host or 'management' in env.host:
run("sudo supervisorctl restart celery")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment