forked from sensu/sensu-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
48 lines (43 loc) · 1.85 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
if ENV['BUILD_NUMBER'].nil?
raise "Must set env var 'BUILD_NUMBER'"
end
if ENV['SENSU_VERSION'].nil?
raise "Must set env var 'SENSU_VERSION'"
end
build_boxes = {
:centos_5_64 => 'http://vagrant.sensuapp.org/centos-5-x86_64.box',
:centos_5_32 => 'http://vagrant.sensuapp.org/centos-5-i386.box',
# :centos_6_64 => 'http://vagrant.sensuapp.org/centos-6-x86_64.box',
# :centos_6_32 => 'http://vagrant.sensuapp.org/centos-6-i386.box',
:ubuntu_1004_32 => 'http://vagrant.sensuapp.org/ubuntu-1004-i386.box',
:ubuntu_1004_64 => 'http://vagrant.sensuapp.org/ubuntu-1004-amd64.box',
# :ubuntu_1104_32 => 'http://vagrant.sensuapp.org/ubuntu-1104-i386.box',
# :ubuntu_1104_64 => 'http://vagrant.sensuapp.org/ubuntu-1104-amd64.box',
# :ubuntu_1110_32 => 'http://vagrant.sensuapp.org/ubuntu-1110-i386.box',
# :ubuntu_1110_64 => 'http://vagrant.sensuapp.org/ubuntu-1110-amd64.box',
# :debian_6_32 => 'http://vagrant.sensuapp.org/debian-6-i386.box',
# :debian_6_64 => 'http://vagrant.sensuapp.org/debian-6-amd64.box',
# :debian_5_32 => '',
# :debian_5_64 => ''
}
Vagrant::Config.run do |vagrant|
build_boxes.each_pair do |name,url|
vagrant.vm.define name do |config|
config.vm.box = name.to_s
config.vm.box_url = url
# convert underscores in hostname to '-' so ubuntu 10.04's hostname(1)
# doesn't freak out on us.
hostname = "sensu-build-#{name.to_s.tr('_','-')}"
config.vm.host_name = hostname
config.vm.customize ['modifyvm', :id, '--memory', '640']
config.vm.customize ['modifyvm', :id, '--cpus', '1']
config.vm.provision :shell do |shell|
shell.inline = "cd /vagrant && \
./build.sh #{ENV['SENSU_VERSION']} #{ENV['BUILD_NUMBER']} \
&& shutdown -h now"
end
end
end
end