-
Notifications
You must be signed in to change notification settings - Fork 19
/
Vagrantfile
45 lines (38 loc) · 1.36 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
# this is used for testing wwtd itself, wwtd does not use vagrant
Vagrant.configure(2) do |config|
config.vm.box = 'minimal/trusty64'
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--usb", "off"]
vb.customize ["modifyvm", :id, "--usbehci", "off"]
end
# I tried to install rvm using chef and travis cookbooks but it was total pain,
# so I switched to this solution http://stackoverflow.com/questions/27961797/vagrantfile-inline-script-and-rvm-provisioning
config.vm.provision "shell", inline: <<-SHELL
RUBY_VERSION="2.0.0"
sudo apt-get -y update
sudo apt-get -y install curl
# Install ruby environment
if ! type rvm >/dev/null 2>&1; then
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -L https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
fi
if ! rvm list rubies ruby | grep ruby-${RUBY_VERSION}; then
rvm install ${RUBY_VERSION}
fi
RUBY_V="2.1.5"
if ! rvm list rubies ruby | grep ruby-${RUBY_V}; then
rvm install ${RUBY_V}
fi
RUBY_V="2.2.1"
if ! rvm list rubies ruby | grep ruby-${RUBY_V}; then
rvm install ${RUBY_V}
fi
RUBY_V="jruby-1.7.19"
if ! rvm list rubies ruby | grep ruby-${RUBY_V}; then
rvm install ${RUBY_V}
fi
rvm --default use ${RUBY_VERSION}
rvm all do gem install bundler
SHELL
end