Provision the box for Ruby on Rails application
This commit is contained in:
parent
33bc89c1b3
commit
72a36d9084
2 changed files with 37 additions and 0 deletions
2
Vagrantfile
vendored
2
Vagrantfile
vendored
|
@ -12,4 +12,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
config.vm.provider "virtualbox" do |v|
|
||||
v.memory = 1024
|
||||
end
|
||||
|
||||
config.vm.provision 'shell', path: 'provision/bootstrap.sh'
|
||||
end
|
||||
|
|
35
provision/bootstrap.sh
Normal file
35
provision/bootstrap.sh
Normal 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
|
Loading…
Reference in a new issue