Browse files

Added fab commands to control Apache and memcached.

  • Loading branch information...
1 parent d585fb3 commit 8244280e30fcdad025482a224c32dd66f02043e2 @jacobian jacobian committed Oct 12, 2010
Showing with 15 additions and 4 deletions.
  1. +15 −4 fabfile.py
View
19 fabfile.py
@@ -20,16 +20,27 @@ def deploy():
"""
deploy_code()
update_dependencies()
- # migrate()
- # apache("restart")
- # memcached("restart")
+ apache("restart")
+ memcached("restart")
def quick_deploy():
"""
Quick deploy: new code and an in-place reload.
"""
deploy_code()
- # apache("reload")
+ apache("reload")
+
+def apache(cmd):
+ """
+ Manage the apache service. For example, `fab apache:restart`.
+ """
+ sudo('invoke-rc.d apache2 %s' % cmd)
+
+def memcached(cmd):
+ """
+ Manage the memcached service. For example, `fab apache:restart`.
+ """
+ sudo('invoke-rc.d memcached %s' % cmd)
def deploy_code(ref=None):
"""

0 comments on commit 8244280

Please sign in to comment.