forked from brightmix/chef-solo-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver-bootstrap
executable file
·41 lines (31 loc) · 1.57 KB
/
server-bootstrap
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
apt-get update;
apt-get -y install build-essential wget curl ssl-cert rsync git-core;
apt-get -y install libreadline5-dev zlib1g-dev libssl-dev libxml2-dev libxslt1-dev;
# In Case we want to install ruby without rvm
# apt-get -y install ruby ruby-dev libopenssl-ruby rdoc ri irb;
# cd /tmp;
# wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz;
# tar zxf rubygems-1.8.10.tgz;
# cd rubygems-1.8.10;
# ruby setup.rb --no-format-executable --no-ri --no-rdoc;
cd /tmp;
curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer;
chmod +x rvm-installer;
./rvm-installer --version latest;
source /usr/local/rvm/bin/rvm;
/usr/local/rvm/bin/rvm install 1.9.2;
/usr/local/rvm/bin/rvm --default 1.9.2;
/usr/local/rvm/bin/rvm use 1.9.2@orly --create;
#echo 'source /usr/local/rvm/bin/rvm > /dev/null; /usr/local/rvm/bin/rvm use 1.9.2@orly' >> /etc/profile;
# http://stackoverflow.com/questions/5792707/cannot-change-rvm-gemset-from-shell-script-via-rvm-gemset-use
# http://stackoverflow.com/questions/5352827/why-doesnt-rvm-work-in-a-bash-script-like-it-works-in-an-interactive-shell
# http://stackoverflow.com/questions/496702/can-a-shell-script-set-environment-variables-of-the-calling-shell
# http://blog.ninjahideout.com/posts/rvm-system-wide-installs-and-capistrano-integration
echo "[[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm';" >> /etc/profile
echo "rvm use 1.9.2@orly;" >> /etc/profile
source /etc/profile;
gem install chef --no-rdoc --no-ri;
gem install ohai --no-rdoc --no-ri;
touch /etc/bootstrapped;
echo "\n\n INSTALLATION ENDED ************ \n\n ";
exit;