Improvements to search page
[oweals/karmaworld.git] / Vagrantfile
index f64610f128537f58515e0c18df87cc8507ec8243..7a784dc3b48b4d97d470f9ca39a2f113fdcf2bb2 100644 (file)
@@ -17,9 +17,10 @@ VAGRANTFILE_API_VERSION = "2"
 # http://serverfault.com/questions/491343/how-can-i-move-my-deploy-key-into-vagrant#comment549259_491345
 git_ssh_key = File.read(ENV['HOME'] + '/.vagrant.d/insecure_private_key');
 
-# 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.
+# build a shell script that installs prereqs, copies over the host secrets,
+# 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
 cat >>/home/vagrant/.ssh/insecure_private_key <<EOF
 #{git_ssh_key}
@@ -37,11 +38,16 @@ Host 127.0.0.1
 EOF
 chmod 644 /home/vagrant/.ssh/config
 
+export DEBIAN_FRONTEND=noninteractive
+
+add-apt-repository -y ppa:coolwanglu/pdf2htmlex # pdf2htmlex
+
 apt-get update
 apt-get upgrade -y
 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
+                   libxml2-dev libmemcached-dev python-dev rabbitmq-server \
+                   p7zip-full pdf2htmlex
 
 echo "CREATE USER vagrant WITH CREATEROLE LOGIN; CREATE DATABASE karmaworld OWNER vagrant;" | su postgres -c "psql"
 
@@ -51,8 +57,11 @@ usermod -a -G www-data vagrant
 
 su vagrant -c "git clone /vagrant karmaworld"
 
-SECRETPATH="karmaworld/karmaworld/secret"
-CFILE="$SECRETPATH/db_settings.py"
+SECRETPATH="karmaworld/secret"
+
+su vagrant -c "cp /vagrant/$SECRETPATH/* karmaworld/$SECRETPATH/"
+
+CFILE="karmaworld/$SECRETPATH/db_settings.py"
 cat > $CFILE <<CONFIG
 #!/usr/bin/env python
 # -*- coding:utf8 -*-
@@ -64,8 +73,6 @@ 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
 
 cat > /etc/nginx/sites-available/karmaworld <<CONFIG
@@ -90,7 +97,6 @@ chmod 755 /etc/init.d/supervisor
 update-rc.d supervisor defaults
 
 pip install fabric
-#su vagrant -c "cd karmaworld; fab here first_deploy"
 SCRIPT
 # end of script