author | rougeronj |
Tue, 08 Sep 2015 10:31:21 +0200 | |
changeset 100 | f61bab1a115d |
parent 8 | 5a0cbbe0922a |
permissions | -rw-r--r-- |
8
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
1 |
require 'json' |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
2 |
require 'yaml' |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
3 |
|
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
4 |
VAGRANTFILE_API_VERSION = "2" |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
5 |
confDir = $confDir ||= File.expand_path("conf") |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
6 |
|
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
7 |
homesteadYamlPath = confDir + "/Homestead.yaml" |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
8 |
afterScriptPath = confDir + "/after.sh" |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
9 |
aliasesPath = confDir + "/aliases" |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
10 |
|
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
11 |
require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb') |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
12 |
|
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
13 |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
14 |
if File.exists? aliasesPath then |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
15 |
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases" |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
16 |
end |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
17 |
|
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
18 |
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath))) |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
19 |
|
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
20 |
if File.exists? afterScriptPath then |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
21 |
config.vm.provision "shell", path: afterScriptPath |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
22 |
end |
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
diff
changeset
|
23 |
end |