Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 93 lines (77 sloc) 2.324 kb
742eae4 @jedi4ever updated rake tasks for bundler
jedi4ever authored
1 require 'rubygems'
2 require 'bundler'
3 require 'bundler/setup'
4 Bundler::GemHelper.install_tasks
5
ff2c117 @jedi4ever Almost working
jedi4ever authored
6 #Setup some base variables to use
132e53c @jedi4ever updated virtualbox template for ubuntu 10.10
jedi4ever authored
7 veewee_dir= "."
ff2c117 @jedi4ever Almost working
jedi4ever authored
8 definition_dir= File.expand_path(File.join(veewee_dir, "definitions"))
9 lib_dir= File.expand_path(File.join(veewee_dir, "lib"))
2f88ab9 @jedi4ever added export output
jedi4ever authored
10 box_dir= File.expand_path(File.join(veewee_dir, "boxes"))
ff2c117 @jedi4ever Almost working
jedi4ever authored
11 template_dir=File.expand_path(File.join(veewee_dir, "templates"))
12 vbox_dir=File.expand_path(File.join(veewee_dir, "tmp"))
1a2e91a @jedi4ever Added support to find out the current version of virtualbox in the guest...
jedi4ever authored
13 tmp_dir=File.expand_path(File.join(veewee_dir, "tmp"))
ff2c117 @jedi4ever Almost working
jedi4ever authored
14 iso_dir=File.expand_path(File.join(veewee_dir, "iso"))
495234d @jedi4ever Snapshots get taken now after each step:
jedi4ever authored
15
ff2c117 @jedi4ever Almost working
jedi4ever authored
16
17 #Load Veewee::Session libraries
18 Dir.glob(File.join(lib_dir, '**','*.rb')).each {|f|
19 require f }
20
21 #Initialize
1a2e91a @jedi4ever Added support to find out the current version of virtualbox in the guest...
jedi4ever authored
22 Veewee::Session.setenv({:veewee_dir => veewee_dir, :definition_dir => definition_dir,
23 :template_dir => template_dir, :iso_dir => iso_dir, :box_dir => box_dir, :tmp_dir => tmp_dir})
ff2c117 @jedi4ever Almost working
jedi4ever authored
24
25 desc 'Default: list templates'
26 task :default => [:templates]
27
28 desc 'List templates'
29 task :templates do
30 Veewee::Session.list_templates
31 end
32
33 desc 'Define box'
34 task :define, [:boxname,:template_name] do |t,args|
35 if args.to_hash.size!=2
36 puts "needs two arguments: rake define['boxname','template_name']"
37 exit
38 end
39 Veewee::Session.define(args.boxname,args.template_name)
40 end
41
42 desc 'Undefine box'
43 task :undefine, [:boxname] do |t,args|
44 if args.to_hash.size!=1
45 puts "needs one arguments: rake undefine[\"yourname\"]"
46 exit
47 end
48 Veewee::Session.undefine(args.boxname)
49 end
50
51 desc 'List Definitions'
52 task :definitions do
53 Veewee::Session.list_definitions
54 end
b18ac61 @jedi4ever first commit: recovered some code, not working though
jedi4ever authored
55
56 desc 'Build box'
ff2c117 @jedi4ever Almost working
jedi4ever authored
57 task :build, [:boxname] do |t,args|
58 if args.to_hash.size!=1
59 puts "needs one arguments: rake build['boxname']"
60 exit
61 end
62 Veewee::Session.build(args.boxname)
63 end
64
65 desc 'List boxes'
66 task :boxes do
67 Veewee::Session.list_boxes
68 end
b18ac61 @jedi4ever first commit: recovered some code, not working though
jedi4ever authored
69
2f88ab9 @jedi4ever added export output
jedi4ever authored
70 desc 'Export box'
71 task :export, [:boxname] do |t,args|
72 if args.to_hash.size!=1
73 puts "needs one arguments: rake export['boxname']"
74 exit
75 end
76 Veewee::Session.export_box(args.boxname)
77 end
78
ff2c117 @jedi4ever Almost working
jedi4ever authored
79 desc 'Remove box'
80 task :remove_box, [:boxname] do |t,args|
81 Veewee::Session.remove_box(args.boxname)
b18ac61 @jedi4ever first commit: recovered some code, not working though
jedi4ever authored
82 end
83
136de45 @jedi4ever OS types are now verified and added rake list_ostypes to give a list
jedi4ever authored
84 desc 'List ostypes available'
85 task :list_ostypes do |t,args|
86 Veewee::Session.list_ostypes
87 end
88
ff2c117 @jedi4ever Almost working
jedi4ever authored
89 desc 'Clean all unfinished builds'
90 task :clean do
91 Veewee::Session.clean
2f88ab9 @jedi4ever added export output
jedi4ever authored
92 end
Something went wrong with that request. Please try again.