-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathVagrantfile
61 lines (49 loc) · 1.94 KB
/
Vagrantfile
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
Vagrant.configure("2") do |config|
config.vm.box = "lucid64"
config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--name", "buildpack-s3cmd", "--memory", "512"]
end
config.vm.provision "shell", inline: <<-EOS
if [ ! -x "/usr/bin/git" ];then
echo "Installing git"
apt-get update -qq
apt-get install -y -qq git-core
fi
version=2.0.0-p247
alt=`echo $version | sed -e "s/-.*//g" -e "s/\\.//g"`
if [ ! -x "/usr/bin/ruby$version" ]; then
echo "Installing ruby $version"
echo ' Installing build requirements...'
apt-get update -qq
apt-get install -qq -y build-essential autoconf libxslt1.1 libssl-dev \
libxslt1-dev libxml2 libffi-dev libyaml-dev libxslt-dev libc6-dev \
libreadline6-dev zlib1g-dev libcurl4-openssl-dev ncurses-dev
cd /tmp
wget -q ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-$version.tar.gz -O ruby-$version.tar.gz
tar xvf ruby-$version.tar.gz > /dev/nul
cd ruby-$version
echo ' Building ruby...'
autoconf > /dev/null
./configure --with-ruby-version=$version --prefix=/usr --program-suffix=$version --disable-install-doc --with-opt-dir=/usr/include > /dev/null
make > /dev/null
echo ' Installing ruby...'
make install-nodoc > /dev/null
update-alternatives \
--install /usr/bin/ruby ruby /usr/bin/ruby$version $alt \
--slave /usr/bin/erb erb /usr/bin/erb$version \
--slave /usr/bin/irb irb /usr/bin/irb$version \
--slave /usr/bin/rdoc rdoc /usr/bin/rdoc$version \
--slave /usr/bin/ri ri /usr/bin/ri$version \
--slave /usr/bin/rake rake /usr/bin/rake$version \
--slave /usr/bin/testrb testrb /usr/bin/testrb$version
update-alternatives --install /usr/bin/gem gem /usr/bin/gem$version $alt
update-alternatives --config ruby
update-alternatives --config gem
fi
gem list bundler | grep bundler ||
gem install bundler --no-rdoc --no-ri
cd /vagrant && bundle install
echo 'Done.'
EOS
end