forked from userfrosting/UserFrosting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
32 lines (25 loc) · 971 Bytes
/
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
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("vagrant/homestead", File.dirname(__FILE__))
homesteadYamlPath = "vagrant/bootstrap.yaml"
afterScriptPath = "vagrant/after.sh"
aliasesPath = "vagrant/aliases"
require File.expand_path(confDir + '/scripts/homestead.rb')
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end
if File.exists? homesteadYamlPath then
settings = YAML::load(File.read(homesteadYamlPath))
Homestead.configure(config, settings)
end
if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
config.vm.provider :virtualbox do |vb|
vb_name = settings["name"] ||= "homestead-7"
vb_name = vb_name + "_" + File.basename(Dir.pwd)
vb.name = vb_name
end
end