reverting back to original, pre-VM setup
[oweals/karmaworld.git] / Vagrantfile
index dc458caaab3a854aff1072f1857d1785cd6581e9..33bfec90fb30bcfb1b760bd09576b2293ad467ba 100644 (file)
@@ -14,17 +14,41 @@ VAGRANTFILE_API_VERSION = "2"
 
 # Install fabric so that the KarmaWorld fabfile may be run.
 
-# build a shell script that installs prereqs, configures the database, pulls in
-# the code from the host machine, and then runs fabric.
+# build a shell script that installs prereqs, configures the database, sets up
+# the user/group associations, pulls in the code from the host machine, sets up
+# some external dependency configs, and then runs fabric.
 shellscript = <<SCRIPT
 apt-get update
 apt-get upgrade -y
-apt-get install -y python-pip postgresql python-virtualenv virtualenvwrapper git
+apt-get install -y python-pip postgresql python-virtualenv virtualenvwrapper \
+                   git nginx postgresql-server-dev-9.1 libxslt1-dev \
+                   libxml2-dev libmemcached-dev python-dev rabbitmq-server
 
 echo "CREATE USER vagrant WITH CREATEROLE LOGIN; CREATE DATABASE karmaworld OWNER vagrant;" | su postgres -c "psql"
 
+mkdir -m 775 -p /var/www
+chown -R :www-data /var/www
+usermod -a -G www-data vagrant
+
 su vagrant -c "git clone /vagrant karmaworld"
 
+SECRETPATH="karmaworld/karmaworld/secret"
+CFILE="$SECRETPATH/db_settings.py"
+cat > $CFILE <<CONFIG
+#!/usr/bin/env python
+# -*- coding:utf8 -*-
+# Copyright (C) 2012  FinalsClub Foundation
+"""
+DO NOT check this file into source control.
+"""
+PROD_DB_NAME = 'karmaworld'
+PROD_DB_USERNAME = 'vagrant'
+PROD_DB_PASSWORD = ''
+CONFIG
+cp $SECRETPATH/filepicker.py.example $SECRETPATH/filepicker.py
+cp $SECRETPATH/static_s3.py.example $SECRETPATH/static_s3.py
+chown vagrant:vagrant $SECRETPATH/*.py
+
 pip install fabric
 #su vagrant -c "cd karmaworld; fab here first_deploy"
 SCRIPT