-
Notifications
You must be signed in to change notification settings - Fork 6
/
Vagrantfile
45 lines (31 loc) · 1.2 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
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network :forwarded_port, guest: 4567, host: 4567
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = 2
end
config.vm.provision "bootstrap", type: "shell", inline: <<-SHELL
apt-get update -y
apt-get install -y ruby ruby-dev
apt-get install -y pkg-config build-essential nodejs git libxml2-dev libxslt-dev
apt-get autoremove -yq
gem install --no-ri --no-rdoc bundler -v 1.14.5
SHELL
config.vm.provision "install", type: "shell", privileged: false, inline: <<-SHELL
echo "----------------------------------------------"
echo "Installing dependencies..."
cd /vagrant
bundle config build.nokogiri --use-system-libraries
bundle install
echo '... Done!'
SHELL
config.vm.provision "run", type: "shell", privileged: false, run: "always", inline: <<-SHELL
echo "----------------------------------------------"
echo "Starting up middleman at http://localhost:4567"
echo "If it doesn't come up, check the ~/middleman.log file for any error messages"
killall -9 ruby2.5
cd /vagrant
bundle exec middleman server --watcher-force-polling --watcher-latency=1 &> ~/middleman.log &
SHELL
end