-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathVagrantfile
More file actions
64 lines (55 loc) · 2.1 KB
/
Copy pathVagrantfile
File metadata and controls
64 lines (55 loc) · 2.1 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if ENV["BES_ACCEPT"] == 'true'
# allow specification of base box
VM_BOX=ENV["VM_BOX"] || "bento/centos-7.1"
config.vm.box = VM_BOX
config.vm.provider "virtualbox" do |v, override|
v.customize ["modifyvm", :id, "--cpus", 2]
# base box hasn't enough memory for DB2
v.customize ["modifyvm", :id, "--memory", 4096]
end
unless ENV["BES_PORTS"] == 'false'
config.vm.network :forwarded_port, guest: 52311, host: 52311
config.vm.network :forwarded_port, guest: 80, host: 9080
config.vm.network :forwarded_port, guest: 8080, host: 8080
config.vm.network :forwarded_port, guest: 443, host: 9443
config.vm.network :forwarded_port, guest: 52315, host: 52315
end
# put box on the Virtualbox private network when OHANA is set
OHANA=ENV["OHANA"] || false
if OHANA
config.vm.network :private_network, type: "dhcp"
end
# optionally turn off vbguest, place inside this test to stop it throwing
# error if vbguest gem is not installed
if ENV["VBGUEST_AUTO"] == 'false'
config.vbguest.auto_update = false
end
config.vm.provision "common" , type: "shell" do |c|
c.path = "./scripts/vagrant-provision-common.sh"
end
# using provisioner names only works with vagrant provsion and
# doesn't work with vagrant up.
# https://github.com/mitchellh/vagrant/issues/5139
# So control what type of bes server is built using environment.
config.vm.provision "besserver", type: "shell" do |s|
# default to evaluation edition
if ENV["BES_CONFIG"] == 'prod'
s.path = "./scripts/vagrant-provision-prod.sh"
else
s.path = "./scripts/vagrant-provision-svr.sh"
ARGS = ENV["BES_VERSION"]
s.args = ARGS
end
end
# configure some client containers
config.vm.provision "besclient", type: "shell" do |bc|
if ENV["BES_CLIENT"]
bc.path = "./scripts/vagrant-provision-client.sh"
BC_ARGS = ENV["BES_CLIENT"]
bc.args = BC_ARGS
end
end
end
end