forked from smackers/smack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
37 lines (30 loc) · 1.18 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
Vagrant.configure(2) do |config|
project_name = File.dirname(__FILE__).split("/").last
config.vm.provider "virtualbox" do |vb|
# vb.memory = 2048 # control VM memory (set it to 2GB)
vb.customize ["modifyvm", :id, "--usb", "off"]
vb.customize ["modifyvm", :id, "--usbehci", "off"]
end
config.vm.synced_folder ".", "/home/vagrant/#{project_name}"
config.vm.define :ubuntu do |ubuntu_config|
ubuntu_config.vm.box = "bento/ubuntu-20.04"
end
# This provision, 'fix-no-tty', gets rid of an error during build
# which says "==> default: stdin: is not a tty"
config.vm.provision "fix-no-tty", type: "shell" do |s|
s.privileged = false
s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
end
# TODO ability to choose between the two?
# config.vm.define :opensuse do |opensuse_config|
# opensuse_config.vm.box = "chef/opensuse-13.1"
# end
config.vm.provision "shell", binary: true, privileged: false, inline: <<-SHELL
sudo apt update
sudo apt install -y build-essential
cd /home/vagrant
./#{project_name}/bin/build.sh
echo source smack.environment >> .bashrc
echo cd #{project_name} >> .bashrc
SHELL
end