Skip to content

Commit 163ba38

Browse files
committed
Updated the Vagrant configuration to use a direct HTTPS url from S3. Also touched up the configuration in the bootstrap to ensure that Postgres is actually being restarted and picking up custom configuration
1 parent e89b9f1 commit 163ba38

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

Vagrantfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
VAGRANTFILE_API_VERSION = "2"
55

66
$box = 'coderwall'
7-
$box_url = 'http://cdn.coderwall.com/vagrant/coderwall.box'
7+
# The box is 1GB. Prepare yourself.
8+
#$box_url = 'http://cdn.coderwall.com/vagrant/coderwall.box'
9+
$box_url = 'https://s3.amazonaws.com/coderwall-assets-0/vagrant/coderwall.box'
810
$provision = 'vagrant/bootstrap.sh'
911

1012
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config/database.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1-
default: &default
1+
development:
22
adapter: postgresql
3+
database: coderwall_development
34
encoding: unicode
45
host: localhost
5-
password:
66
pool: 5
7-
port: <%= ENV['DEV_POSTGRES_PORT'] || 5432 %>
7+
port: 5432
88
username: vagrant
99

10-
development:
11-
<<: *default
12-
database: coderwall_development
13-
1410
test:
15-
<<: *default
11+
adapter: postgresql
1612
database: coderwall_test
13+
encoding: unicode
14+
host: localhost
15+
pool: 5
16+
port: 5432
17+
username: vagrant
18+
19+
production:
20+
adapter: postgresql
21+
database: coderwall_production
22+
encoding: unicode
23+
host: localhost
24+
pool: 5
25+
port: 5432
26+
username: vagrant

vagrant/bootstrap.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ echo export EDITOR=vim >> $HOME/.bashrc
88
# Enable accessing Postgres from the host machin
99
echo "listen_addresses = '*'" | tee -a /var/pgsql/data/postgresql.conf
1010
echo host all all 0.0.0.0/0 trust | tee -a /var/pgsql/data/pg_hba.conf
11+
sudo su postgres -c 'pg_ctl stop -D /var/pgsql/data 2>&1'
1112
sudo su postgres -c 'pg_ctl restart -D /var/pgsql/data 2>&1 &'
1213
su -c "source /home/vagrant/web/vagrant/user-config.sh" vagrant

vagrant/user-config.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ bundle install
2727
# Setup .env
2828
cp .env.example .env -n
2929

30-
foreman run rake db:create:all
31-
foreman run rake db:setup
32-
foreman run rake db:test:prepare
30+
sudo su postgres -c 'pg_ctl stop -D /var/pgsql/data 2>&1'
31+
sudo su postgres -c 'pg_ctl restart -D /var/pgsql/data 2>&1 &'
32+
33+
rake db:create:all
34+
rake db:test:prepare
35+
rake db:setup

0 commit comments

Comments
 (0)