authserver/homestead/Vagrantfile
changeset 8 5a0cbbe0922a
equal deleted inserted replaced
7:1a3fa80225b2 8:5a0cbbe0922a
       
     1 require 'json'
       
     2 require 'yaml'
       
     3 
       
     4 VAGRANTFILE_API_VERSION = "2"
       
     5 confDir = $confDir ||= File.expand_path("conf")
       
     6 
       
     7 homesteadYamlPath = confDir + "/Homestead.yaml"
       
     8 afterScriptPath = confDir + "/after.sh"
       
     9 aliasesPath = confDir + "/aliases"
       
    10 
       
    11 require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')
       
    12 
       
    13 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
       
    14 	if File.exists? aliasesPath then
       
    15 		config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
       
    16 	end
       
    17 
       
    18 	Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
       
    19 
       
    20 	if File.exists? afterScriptPath then
       
    21 		config.vm.provision "shell", path: afterScriptPath
       
    22 	end
       
    23 end