-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathVagrantfile
35 lines (26 loc) · 978 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
33
34
35
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'json'
require 'yaml'
Encoding.default_external = 'UTF-8'
VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path("~/.gardening")
GardeningYamlPath = confDir + "/vagrant.yaml"
GardeningJsonPath = confDir + "/vagrant.json"
appendScriptPath = confDir + "/append.sh"
aliasesPath = confDir + "/aliases"
require File.expand_path(File.dirname(__FILE__) + '/scripts/builder.rb')
Vagrant.require_version '>= 2.0.0'
Vagrant.configure(2) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end
if File.exists? GardeningYamlPath then
Builder.configure(config, YAML::load(File.read(GardeningYamlPath)))
elsif File.exists? GardeningJsonPath then
Builder.configure(config, JSON.parse(File.read(GardeningJsonPath)))
end
if File.exists? appendScriptPath then
config.vm.provision "shell", path: appendScriptPath
end
end