Permalink
Browse files

updated vagrant setup for new environment

  • Loading branch information...
1 parent 85fbe04 commit f7ac0793f7206c398a241ef86ad613ac2399c997 @ehazlett ehazlett committed Aug 2, 2012
Showing with 18 additions and 10 deletions.
  1. +1 −0 Vagrantfile
  2. +8 −8 bootstrap-vagrant.sh
  3. +9 −2 vagrant.sh
View
@@ -6,6 +6,7 @@ Vagrant::Config.run do |config|
config.vm.box = "lucid64"
config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
config.vm.network :hostonly, "10.10.10.42"
+ config.vm.customize ["modifyvm", :id, "--memory", 1024]
config.vm.forward_port 80, 8000
config.vm.forward_port 8983, 8983
config.vm.forward_port 9000, 9000
View
@@ -3,20 +3,20 @@
set -e
EXTRAS_DIR='/opt/extras'
-VE_DIR='/opt/ve/unisubs'
-# create virtualenv
-virtualenv --no-site-packages --distribute $VE_DIR
+VE_DIR='/opt/ve/vagrant/unisubs'
+# create virtualenv ; no longer needed
+#virtualenv --no-site-packages --distribute $VE_DIR
# Link folders ----------------------------------------------------------------
mkdir -p $EXTRAS_DIR/static-cache
mkdir -p $EXTRAS_DIR/pictures
mkdir -p $EXTRAS_DIR/video
-test -L venv || ln -s $VE_DIR venv
+test -e venv || ln -sf $VE_DIR venv
test -L media/static-cache || ln -s $EXTRAS_DIR/static-cache media/static-cache
test -L user-data/video || ln -s $EXTRAS_DIR/video user-data/video
test -L user-data/pictures || ln -s $EXTRAS_DIR/pictures user-data/pictures
# Install requirements --------------------------------------------------------
-source venv/bin/activate
+source $VE_DIR/bin/activate
cd deploy
# Hack until we can think of a better solution
#pip install vendor/pycrypto-2.1.0.tar.gz
@@ -82,11 +82,11 @@ python manage.py migrate --fake --settings=dev_settings
sudo ./deploy/update_solr_schema_vagrant.sh
# Adjust sys.path -------------------------------------------------------------
-cat >venv/lib/python2.6/sitecustomize.py <<EOF
+cat > venv/lib/python2.6/sitecustomize.py <<EOF
import sys
try:
- sys.path.remove('/opt/extras/venv/lib/python2.6/site-packages')
+ sys.path.remove('/opt/ve/vagrant/unisubs/lib/python2.6/site-packages')
except ValueError:
pass
@@ -95,7 +95,7 @@ try:
except ValueError:
pass
-sys.path = ['/opt/extras/venv/lib/python2.6/site-packages', '/usr/lib/python2.6'] + sys.path
+sys.path = ['/opt/ve/vagrant/unisubs/lib/python2.6/site-packages', '/usr/lib/python2.6'] + sys.path
EOF
# Celery services -------------------------------------------------------------
View
@@ -1,11 +1,18 @@
#!/bin/sh
-VE_DIR='/opt/ve/unisubs'
+APP_DIR='/opt/apps/vagrant/unisubs'
+VE_DIR='/opt/ve/vagrant/unisubs'
cd /tmp
# install git
sudo apt-get update 2>&1 > /dev/null
sudo apt-get -y install git-core 2>&1 > /dev/null
-# create the env file
+
+# remove existing venv symlink (sifter #1379)
+if [ -e "$APP_DIR/venv" ] ; then
+ rm $APP_DIR/venv
+fi
+
+# create the puppet environment config files
echo "environments:\n - vagrant\n" > /etc/system_environments.yml
echo "roles:\n - vagrant\n" > /etc/system_roles.yml
# clone the puppet modules

0 comments on commit f7ac079

Please sign in to comment.