-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
40 lines (31 loc) · 1.08 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
require "yaml"
conf = YAML.load_file(File.join(__dir__, "config.yaml"))
Vagrant.configure("2") do |config|
conf["vm"].each do |k, v|
config.vm.send("#{k}=", v)
end
config.vm.provider "virtualbox" do |v|
v.name = conf["providers"]["virtualbox"]["name"]
v.customize ["modifyvm", :id].concat(conf["providers"]["virtualbox"]["customize"])
end
config.vm.network :private_network, ip: conf["network"]["private_network"]["ip"]
config.vm.network :public_network
conf["synced_folders"].each do |i|
config.vm.synced_folder i["src"], i["dest"]
end
config.timezone.value = conf["timezone"]
config.vm.provision :docker
config.vm.provision :docker_compose, run: "always",
yml: "/vagrant/docker-compose.yaml"
# Install and configure essential packages
config.vm.provision "essential", type: :shell do |s|
s.privileged = false
s.path = "scripts/essential.sh"
s.args = [conf["git"]["diff_highlight"]]
end
# Install and configure shell
config.vm.provision "shell", type: :shell do |s|
s.privileged = false
s.path = "scripts/shell.sh"
end
end