-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
77 lines (64 loc) · 1.84 KB
/
Rakefile
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
def build_basebox(boxname='gemstone')
cd 'veewee'
%w{build validate export}.each do | command |
sh("vagrant basebox #{command} '#{boxname}'")
end
end
def install_basebox(boxname="gemstone")
cd 'veewee'
sh("vagrant box add '#{boxname}' '#{boxname}.box'")
cd '..'
end
desc "Create a vagrant basebox for the current version of ubuntu"
task "basebox_build" do
build_basebox('gemstone')
end
desc "Create basebox for Ubuntu 11.10 with ruby 1.9.2"
task "basebox_build_11_10" do
build_basebox("gemstone-ubuntu11.10-ruby192")
end
#no automaitc dependency on basebox_build yet (takes long time to run
desc "install already built basebox"
task "basebox_install" do
install_basebox
end
desc "install already built basebox for ubuntu 11.10"
task "basebox_install_11_10" do
install_basebox("gemstone-ubuntu11.10-ruby192")
end
full_box_name = "gemstone-ubuntu11.10-ruby192-full"
desc "package fully loaded box"
task "package_box" do
cd 'vagrant'
rm_rf "package.box"
rm_rf "#{full_box_name}.box"
sh("vagrant package --vagrantfile Vagrantfile.pkg #{full_box_name}")
mv 'package.box', "#{full_box_name}.box"
cd '..'
end
desc "install fully loaded box"
task "add_packaged_box" => ['package_box'] do
cd 'vagrant'
output = `vagrant box list`
sh("vagrant box remove #{full_box_name}") if output.include?(full_box_name)
sh("vagrant box add '#{full_box_name}' #{full_box_name}.box")
cd '..'
end
desc "incremental build starting from fully loaded box"
task "build_incremental" do #dependency management left to jenkins jobs
cd 'vagrant'
sh("vagrant destroy && gemstone_vm=#{full_box_name} vagrant up")
cd '..'
end
desc "run scripts against existing vagrant environment"
task "provision" do
cd 'vagrant'
sh("vagrant provision")
cd '..'
end
desc "spin up vagrant environment"
task "up" do
cd 'vagrant'
sh('vagrant up')
cd '..'
end