Skip to content

Commit 9803ed6

Browse files
committed
Updated the Vagrant bootstrap to be entirely self-contained. The new box image is ready to run from the word 'up'.
1 parent a90504c commit 9803ed6

File tree

2 files changed

+10
-60
lines changed

2 files changed

+10
-60
lines changed

vagrant/bootstrap.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
#!/bin/bash -x
22
export DEBIAN_FRONTEND=noninteractive
3-
cd /home/vagrant
4-
echo Who am I? You are `whoami`.
5-
echo Where am I? You are in `pwd`
6-
echo I think my home is $HOME
7-
echo export EDITOR=vim >> $HOME/.bashrc
8-
# Enable accessing Postgres from the host machine
9-
apt-get -y install libcurl3 libcurl3-dev libcurl3-gnutls libcurl4-openssl-dev
10-
apt-get -y install libpq-dev
11-
apt-get -y install libxml2 libxml2-dev libxslt1-dev
12-
echo "listen_addresses = '*'" | tee -a /var/pgsql/data/postgresql.conf
13-
echo host all all 0.0.0.0/0 trust | tee -a /var/pgsql/data/pg_hba.conf
14-
sudo su postgres -c 'pg_ctl stop -D /var/pgsql/data 2>&1'
15-
sudo su postgres -c 'pg_ctl start -D /var/pgsql/data 2>&1 &'
16-
su -c "ln -s /vagrant /home/vagrant/web" vagrant
17-
su -c "source /home/vagrant/web/vagrant/user-config.sh" vagrant
3+
4+
# Ensure the database is started
5+
su -c '/usr/bin/pg_ctl start -l /var/pgsql/data/log/logfile -D /var/pgsql/data' postgres
6+
7+
sudo su - vagrant <<-'EOF'
8+
cd ~/web
9+
bundle check && bundle install
10+
DEV_POSTGRES_PORT=5432 bundle exec rake db:migrate
11+
DEV_POSTGRES_PORT=5432 bundle exec rake db:test:prepare
12+
EOF

vagrant/user-config.sh

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)