-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
43 lines (38 loc) · 1.19 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Update apt-get once
$update_apt_get = <<SCRIPT
if ! test -f .updated_apt_get; then
sudo apt-get update
touch .updated_apt_get
fi
SCRIPT
config.vm.provision "shell", inline: $update_apt_get
# https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os
$install_node = <<SCRIPT
if ! which node &> /dev/null; then
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y nodejs
fi
SCRIPT
config.vm.provision "shell", inline: $install_node
# Install test dependency on `git`
$install_git = <<SCRIPT
if ! which git &> /dev/null; then
sudo apt-get install git -y
fi
SCRIPT
config.vm.provision "shell", inline: $install_git
# Verify environment is properly configured
$configure_env = <<SCRIPT
if test "$VAGRANT" != "true"; then
echo "VAGRANT=true" >> /etc/environment
fi
SCRIPT
config.vm.provision "shell", inline: $configure_env
end