forked from AgileVentures/LocalSupport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagrant-ubuntu-install.sh
65 lines (47 loc) · 1.93 KB
/
vagrant-ubuntu-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
whoami
echo ~/
sudo apt-get install -y git
sudo apt-get install -y curl
curl -sSL https://get.rvm.io | bash -s stable
source /home/vagrant/.rvm/scripts/rvm
rvm use --install 1.9.3
#\curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3
#source ~/.rvm/scripts/rvm
sudo apt-get install -y libqtwebkit-dev
gem install debugger-ruby_core_source
export LANGUAGE="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
sudo apt-get install -y libpq-dev
sudo apt-get install -y postgresql
# need to edit /etc/postgresql/9.1/main/pg_hba.conf
# needs work to handle variable white space
#
sudo sed -i -e 's/local\s\+all\s\+postgres\s\+peer/local all postgres peer map=basic/g' /etc/postgresql/9.1/main/pg_hba.conf
# need to edit /etc/postgresql/9.1/main/pg_ident.conf
echo "basic vagrant postgres" | sudo tee -a /etc/postgresql/9.1/main/pg_ident.conf
sudo /etc/init.d/postgresql restart
# this needs to run in psql
psql postgres postgres << EOF
UPDATE pg_database SET datallowconn = TRUE where datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UNICODE' LC_CTYPE = 'en_US.UTF-8' LC_COLLATE = 'C';
UPDATE pg_database SET datistemplate = TRUE where datname = 'template1';
\c template1
UPDATE pg_database SET datallowconn = FALSE where datname = 'template0';
EOF
sudo apt-get install -y xvfb
sudo apt-get install libicu48
Xvfb :1 -screen 0 1280x768x24 &
export DISPLAY=:1
cd /LocalSupport
#sudo apt-get install ruby-bundler
#sudo apt-get -y install x-ttcidfont-conf <-- might fix some font errors?
bundle install
bundle exec rake db:create
bundle exec rake db:migrate
# Cool Bash Prompt
echo 'export PS1="\[\033[32m\]\t\[\033[m\]-\[\033[31m\]\u\[\033[m\]@\[\033[36m\]\h\[\033[m\]:\[\033[33;1m\]\w\[\033[35m\]\$(__git_ps1)\[\033[37;0m\]\$ "' >> ~/.bashrc