Permalink
Browse files

Install g++ on build

  • Loading branch information...
1 parent 875df7c commit ffc20c346f14a269e0fee0f575d720325ed355f4 @ericholscher ericholscher committed Nov 15, 2012
Showing with 21 additions and 14 deletions.
  1. +1 −0 .gitignore
  2. +20 −14 deploy/fab/fabfile.py
View
@@ -20,3 +20,4 @@ user_builds
user_uploads
whoosh_index
xml_output
+.idea
View
@@ -2,53 +2,57 @@
from fabric.api import *
import fabtools
-from fabtools import require
cwd = os.getcwd()
all_users = ['docs', 'builder']
-required_dirs =['checkouts', 'etc', 'run', 'log']
+required_dirs = ['checkouts', 'etc', 'run', 'log']
def build():
install_packages('build')
- users()
- checkout()
+ users('build')
+ checkout('build')
setup_env()
+
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 ('easy_install pip')
- sudo ('pip install -U virtualenv' )
+ sudo('easy_install pip')
+ 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')
+ sudo(
+ 'apt-get install -y git-core python-setuptools python-dev postgresql-client libpq-dev subversion graphviz curl sqlite libxml2-dev libxslt-dev vim g++')
+ 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')
-
-def users():
- env.user = 'root'
- for user in all_users:
+def users(user=None):
+ if user:
+ users = [user]
+ else:
+ users = all_users
+ for user in users:
home = '/home/%s' % user
if not fabtools.user.exists(user):
sudo('adduser --gecos "" -q --disabled-password %s' % user)
if not fabtools.files.is_file('%s/.ssh/authorized_keys' % home):
sudo('mkdir -p %s/.ssh' % home)
- put('keys/*.pub', '%s/.ssh/authorized_keys' % home, mode=700)
+ put('keys/*.pub', '%s/.ssh/authorized_keys' % home, mode=700, use_sudo=True)
sudo('chown -R %s:%s %s' % (user, user, home))
sudo('chmod -R 700 %s' % home)
sudo('mkdir -p /var/build')
@@ -74,6 +78,7 @@ def checkout(user=None):
run('virtualenv %s' % home)
run('%s/bin/pip install -U -r %s/checkouts/readthedocs.org/deploy_requirements.txt' % (home, home))
+
def setup_env(user=None):
if user:
users = [user]
@@ -87,6 +92,7 @@ def setup_env(user=None):
#put('files/%s_local_settings.py' % user, '%s/checkouts/readthedocs.org/readthedocs/settings/local_settings.py' % home)
run('%s/bin/pip install -U supervisor ipython gunicorn' % home)
+
def setup_db():
env.user = "docs"
home = '/home/%s' % user

0 comments on commit ffc20c3

Please sign in to comment.