1
0
Fork 0

Provision the box for Ruby on Rails application

This commit is contained in:
Andrew Tomaka 2015-02-05 00:26:12 -05:00
parent 33bc89c1b3
commit 72a36d9084
2 changed files with 37 additions and 0 deletions

2
Vagrantfile vendored
View file

@ -12,4 +12,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |v| config.vm.provider "virtualbox" do |v|
v.memory = 1024 v.memory = 1024
end end
config.vm.provision 'shell', path: 'provision/bootstrap.sh'
end end

35
provision/bootstrap.sh Normal file
View file

@ -0,0 +1,35 @@
#!/bin/bash
readonly RUBY_VERSION=2.2.0
install-pre-requisites () {
apt-get update
apt-get install wget software-properties-common libxml2 libxml2-dev \
libxslt1-dev -y
}
install-ruby () {
apt-add-repository ppa:brightbox/ruby-ng
apt-get update
apt-get install ruby2.2 ruby2.2-dev -y
gem install bundler
}
install-farmers_market () {
cd /home/vagrant/app
bundle install
}
main () {
install-pre-requisites
install-ruby
if [ -f /home/vagrant/app/Gemfile ]; then
install-farmers_market
fi
}
main