Permalink
Browse files

Refactor deploy fabfile.

  • Loading branch information...
ericholscher committed Oct 24, 2012
1 parent fa757e3 commit deb197fd641a7ba70a933b6d94a501006a3c57c3
Showing with 22 additions and 7 deletions.
  1. +22 −7 deploy/fab/fabfile.py
View
@@ -8,21 +8,36 @@
all_users = ['docs', 'builder']
required_dirs =['checkouts', 'etc', 'run', 'log']
-def all():
- install_packages()
+def build():
+ install_packages('build')
users()
checkout()
setup_env()
-def install_packages():
+def web():
+ install_packages('web')
+ users('docs')
+ checkout('docs')
+ setup_env()
+
+def db():
+ install_packages('db')
+
+def install_packages(type):
env.user = 'root'
sudo('apt-get update')
- sudo('apt-get install -y git-core python-setuptools python-dev postgresql-client libpq-dev subversion graphviz curl sqlite libxml2-dev libxslt-dev vim')
sudo ('easy_install pip')
- sudo ('pip install -U virtualenv mercurial')
+ sudo ('pip install -U virtualenv' )
+
+ if type == 'build':
+ sudo('apt-get install -y git-core python-setuptools python-dev postgresql-client libpq-dev subversion graphviz curl sqlite libxml2-dev libxslt-dev vim')
+ sudo ('pip install -U mercurial')
+ if type == 'db':
+ sudo('apt-get install -y solr-tomcat redis-server postgresql ')
+ if type == 'web':
+ sudo('apt-get install -y nginx')
+
- # Prod Packages
- sudo('apt-get install -y redis-server memcached')
def users():
env.user = 'root'

0 comments on commit deb197f

Please sign in to comment.