A Vagrantfile based on debian/jessie64 (#708)

* Add VagrantFile compatible from debian/jessie64 box and latest ruby stable version (2.4.0)

* Fix indent in vagrantfile for jessie64

* Remove Vagrantfile for Jessie

* Replace Vagrantfile with debian/jessie and last ruby version
This commit is contained in:
Benjamin Chenebault 2017-03-31 21:57:15 +02:00 committed by Robert Lord
parent 61d7f08ff2
commit 7b1e718672

31
Vagrantfile vendored
View file

@ -1,21 +1,28 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box = "debian/jessie64"
config.vm.network :forwarded_port, guest: 4567, host: 4567
config.vm.synced_folder ".", "/vagrant", type: "rsync"
config.vm.provision "bootstrap",
type: "shell",
# Download and install ruby from sources and other tools
config.vm.provision "shell",
inline: <<-SHELL
sudo apt-get update
sudo apt-get install -yq ruby2.0 ruby2.0-dev pkg-config build-essential nodejs git libxml2-dev libxslt-dev
sudo apt-get autoremove -yq
gem2.0 install --no-ri --no-rdoc bundler
apt-get -yq install zlib1g-dev libssl-dev libreadline-dev libgdbm-dev openssl git libxml2-dev libxslt-dev build-essential nodejs
wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.gz
tar xvfz ruby-2.4.0.tar.gz
cd ruby-2.4.0
./configure
make
make install
gem install --no-ri --no-rdoc bundler
rm -rf ruby-2.4.0.tar.gz ruby-2.4.0
apt-get autoremove -yq
SHELL
# add the local user git config to the vm
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
config.vm.provision "install",
type: "shell",
# Install project dependencies (gems)
config.vm.provision "shell",
privileged: false,
inline: <<-SHELL
echo "=============================================="
@ -25,8 +32,8 @@ Vagrant.configure(2) do |config|
bundle install
SHELL
config.vm.provision "run",
type: "shell",
# Exec server
config.vm.provision "shell",
privileged: false,
run: "always",
inline: <<-SHELL
@ -34,6 +41,6 @@ Vagrant.configure(2) do |config|
echo "Starting up middleman at http://localhost:4567"
echo "If it does not come up, check the ~/middleman.log file for any error messages"
cd /vagrant
bundle exec middleman server --force-polling --latency=1 &> ~/middleman.log &
bundle exec middleman server --watcher-force-polling --watcher-latency=1 &> ~/middleman.log &
SHELL
end