From 483ecd3202543881bcdb7f99f856c23a61d30c75 Mon Sep 17 00:00:00 2001 From: Karl Krueger Date: Thu, 20 Apr 2017 14:19:27 -0700 Subject: [PATCH] Refresh Vagrantfile to install all the things. Also, add a .gitignore to get git to ignore things. --- vagrant/.gitignore | 3 +++ vagrant/Vagrantfile | 29 ++++++++++++++++++++++++----- vagrant/pg_config.sh | 25 ------------------------- 3 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 vagrant/.gitignore delete mode 100644 vagrant/pg_config.sh diff --git a/vagrant/.gitignore b/vagrant/.gitignore new file mode 100644 index 0000000000..ad14d896b7 --- /dev/null +++ b/vagrant/.gitignore @@ -0,0 +1,3 @@ +__pycache__ +*.pyc +.vagrant diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index f239edc0de..7ae5517843 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -1,12 +1,31 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -VAGRANTFILE_API_VERSION = "2" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.provision "shell", path: "pg_config.sh" - config.vm.box = "ubuntu/trusty32" +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/xenial32" config.vm.network "forwarded_port", guest: 8000, host: 8000 config.vm.network "forwarded_port", guest: 8080, host: 8080 config.vm.network "forwarded_port", guest: 5000, host: 5000 + config.vm.provision "shell", inline: <<-SHELL + apt-get update + apt-get upgrade + apt-get -qqy install make python3-pip + apt-get -qqy install postgresql + pip3 install --upgrade pip + pip3 install flask packaging oauth2client redis passlib flask-httpauth + pip3 install sqlalchemy flask-sqlalchemy psycopg2 bleach + su postgres -c 'createuser -dRS ubuntu' + su ubuntu -c 'createdb' + su ubuntu -c 'createdb forum' + su ubuntu -c 'psql forum -f /vagrant/forum/forum.sql' + + vagrantTip="The shared directory is located at /vagrant\\nTo access your shared files: cd /vagrant" + echo -e $vagrantTip > /etc/motd + + wget http://download.redis.io/redis-stable.tar.gz + tar xvzf redis-stable.tar.gz + cd redis-stable + make + make install + SHELL end diff --git a/vagrant/pg_config.sh b/vagrant/pg_config.sh deleted file mode 100644 index 4de1ad1790..0000000000 --- a/vagrant/pg_config.sh +++ /dev/null @@ -1,25 +0,0 @@ -apt-get -qqy update -apt-get -qqy install postgresql python-psycopg2 -apt-get -qqy install python-flask python-sqlalchemy -apt-get -qqy install python-pip -pip install bleach -pip install oauth2client -pip install requests -pip install httplib2 -pip install redis -pip install passlib -pip install itsdangerous -pip install flask-httpauth -su postgres -c 'createuser -dRS vagrant' -su vagrant -c 'createdb' -su vagrant -c 'createdb forum' -su vagrant -c 'psql forum -f /vagrant/forum/forum.sql' - -vagrantTip="The shared directory is located at /vagrant\nTo access your shared files: cd /vagrant(B" -echo -e $vagrantTip > /etc/motd - -wget http://download.redis.io/redis-stable.tar.gz -tar xvzf redis-stable.tar.gz -cd redis-stable -make -make install