forked from mozilla-services/socorro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
77 lines (61 loc) · 2.42 KB
/
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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
require "yaml"
# Load up our vagrant config files -- vagrantconfig.yaml first
_config = YAML.load(File.open(File.join(File.dirname(__FILE__),
"vagrantconfig.yaml"), File::RDONLY).read)
# Local-specific/not-git-managed config -- vagrantconfig_local.yaml
begin
_config.merge!(YAML.load(File.open(File.join(File.dirname(__FILE__),
"vagrantconfig_local.yaml"), File::RDONLY).read))
rescue Errno::ENOENT # No vagrantconfig_local.yaml found -- that's OK; just
# use the defaults.
end
CONF = _config
Vagrant::Config.run do |config|
config.vm.box = "CentOS-6.4-i386-v20130427"
config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-i386-v20130427.box"
Vagrant.configure("1") do |config|
config.vm.customize ["modifyvm", :id, "--memory", CONF['memory']]
end
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
v.name = "Socorro_VM"
v.customize ["modifyvm", :id, "--memory", CONF['memory']]
end
end
is_jenkins = ENV['USER'] == 'jenkins'
if not is_jenkins
# Don't share these resources when on Jenkins. We want to be able to
# parallelize jobs.
config.vm.network :hostonly, "10.11.12.13"
end
# Enable symlinks, which google-breakpad uses during build:
Vagrant.configure("1") do |config|
config.vm.customize ["setextradata", :id,
"VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant-root",
"1"]
end
Vagrant.configure("2") do |config|
v.customize ["setextradata", :id,
"VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant-root",
"1"]
end
if CONF['boot_mode'] == 'gui'
config.vm.boot_mode = :gui
end
MOUNT_POINT = '/home/vagrant/src/socorro'
# Don't mount shared folder over NFS on Jenkins; NFS doesn't work there yet.
if is_jenkins or CONF['nfs'] == false or RUBY_PLATFORM =~ /mswin(32|64)/
config.vm.share_folder("vagrant-root", MOUNT_POINT, ".",
:extra => 'dmode=777,fmode=777')
else
config.vm.share_folder("vagrant-root", MOUNT_POINT, ".", :nfs => true)
end
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "init.pp"
# enable this to see verbose and debug puppet output
if CONF['debug_mode'] == true
puppet.options = "--verbose --debug"
end
end
end