Add homestead support
This commit is contained in:
parent
fa56165df6
commit
24fadc0cb2
5 changed files with 69 additions and 1 deletions
28
Vagrantfile
vendored
Normal file
28
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
require 'json'
|
||||
require 'yaml'
|
||||
|
||||
VAGRANTFILE_API_VERSION ||= "2"
|
||||
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
|
||||
|
||||
homesteadYamlPath = "Homestead.yaml"
|
||||
homesteadJsonPath = "Homestead.json"
|
||||
afterScriptPath = "after.sh"
|
||||
aliasesPath = "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
|
||||
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
|
||||
elsif File.exists? homesteadJsonPath then
|
||||
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
|
||||
end
|
||||
|
||||
if File.exists? afterScriptPath then
|
||||
config.vm.provision "shell", path: afterScriptPath
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue