veewee 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- veewee (0.1.4)
4
+ veewee (0.1.5)
5
5
  highline (~> 1.6.1)
6
6
  net-ssh (~> 2.1.0)
7
7
  popen4 (~> 0.1.2)
data/README.md CHANGED
@@ -12,29 +12,42 @@ ALPHA CODE: -> you're on your own....
12
12
 
13
13
  ## Installation:
14
14
  __from source__
15
+
16
+ <pre>
15
17
  $ git clone https://github.com/jedi4ever/veewee.git
16
18
  $ cd veewee
17
19
  $ gem install bundler
18
20
  $ bundle install
19
-
21
+ </pre>
20
22
  __as a gem__
23
+ <pre>
21
24
  $ gem install veewee
22
-
25
+ </pre>
23
26
 
24
27
  ## List all templates
28
+ <pre>
25
29
  $ vagrant basebox templates
30
+ The following templates are available:
31
+ vagrant basebox define 'boxname' 'CentOS-4.8-i386'
32
+ vagrant basebox define 'boxname' 'CentOS-5.5-i386'
33
+ vagrant basebox define 'boxname' 'CentOS-5.5-i386-netboot'
34
+ vagrant basebox define 'boxname' 'ubuntu-10.04.1-server-amd64'
35
+ vagrant basebox define 'boxname' 'ubuntu-10.04.1-server-i386'
36
+ vagrant basebox define 'boxname' 'ubuntu-10.10-server-amd64'
37
+ vagrant basebox define 'boxname' 'ubuntu-10.10-server-i386'
26
38
 
27
- ## Define a new box (ex. Ubuntu 10.10 server i386)
28
-
39
+ </pre>
40
+ ## Define a new box
41
+ Let's define a Ubuntu 10.10 server i386 basebox called myunbuntubox
29
42
  this is essentially making a copy based on the templates provided above.
30
-
31
- $ vagrant basebox define 'myubuntubox' 'ubuntu-10.10-server-i386'
43
+ <pre>$ vagrant basebox define 'myubuntubox' 'ubuntu-10.10-server-i386'</pre>
32
44
  template successfully copied
33
45
 
34
46
  -> This copies over the templates/ubuntu-10.10-server-i386 to definition/myubuntubox
35
47
 
36
- $ ls definitions/myubuntubox
48
+ <pre>$ ls definitions/myubuntubox
37
49
  definition.rb postinstall.sh postinstall2.sh preseed.cfg
50
+ </pre>
38
51
 
39
52
  ## Optionally modify the definition.rb , postinstall.sh or preseed.cfg
40
53
 
@@ -69,14 +82,16 @@ Veewee::Session.declare( {
69
82
 
70
83
  If you need to change values in the templates, be sure to run the rake undefine, the rake define again to copy the changes across.
71
84
 
72
- ## Put your isofile inside the $VEEWEE/iso directory or if you don't run
73
- $ vagrant basebox build 'myubuntubox'
85
+ ## Getting the cdrom file in place
86
+ Put your isofile inside the 'currentdir'/iso directory or if you don't run
87
+ <pre>$ vagrant basebox build 'myubuntubox'</pre>
74
88
 
75
- -> the build assumes your iso files are in 'currentdir'/iso
76
- -> if it can not find it will suggest to download the iso for you
89
+ - the build assumes your iso files are in 'currentdir'/iso
90
+ - if it can not find it will suggest to download the iso for you
77
91
 
78
92
  ## Build the new box:
79
- $ vagrant basebox build 'myubuntubox'
93
+ <pre>
94
+ $ vagrant basebox build 'myubuntubox'</pre>
80
95
 
81
96
  - This will create a machine + disk according to the definition.rb
82
97
  - Note: :os_type_id = The internal Name Virtualbox uses for that Distribution
@@ -88,24 +103,25 @@ $ vagrant basebox build 'myubuntubox'
88
103
  - Sudo execute the :postinstall_files
89
104
 
90
105
  ## Export the vm to a .box file
91
- $ vagrant basebox export 'myubuntubox'
106
+ <pre>$ vagrant basebox export 'myubuntubox' </pre>
92
107
 
93
108
  this is actually calling - vagrant package --base 'myubuntubox' --output 'boxes/myubuntubox.box'
94
109
 
95
110
  this will result in a myubuntubox.box
96
111
 
97
112
  ## Add the box as one of your boxes
98
- $ vagrant box add 'myubuntubox' 'myubuntubox.box'
113
+ To import it into vagrant type:
99
114
 
115
+ <pre>$ vagrant box add 'myubuntubox' 'myubuntubox.box'
116
+ </pre>
100
117
  ## Use it in vagrant
101
- Start vagrant init in another window (as we have set the Virtualbox env to tmp before)
102
- $ To import it into vagrant type:
103
118
 
104
119
  To use it:
105
- vagrant init 'myubuntubox'
106
- vagrant up
107
- vagrant ssh
108
-
120
+ <pre>
121
+ $ vagrant init 'myubuntubox'
122
+ $ vagrant up
123
+ $ vagrant ssh
124
+ </pre>
109
125
  ## If you have a setup working, share your 'definition' with me. That would be fun!
110
126
 
111
127
  IDEAS:
@@ -132,7 +132,7 @@ module Veewee
132
132
  end
133
133
 
134
134
  def self.list_definitions
135
- puts "The following defined baseboxes exit:"
135
+ puts "The following defined baseboxes exist:"
136
136
  subdirs=Dir.glob("#{@definition_dir}/*")
137
137
  subdirs.each do |sub|
138
138
  puts "- "+File.basename(sub)
@@ -197,7 +197,7 @@ module Veewee
197
197
 
198
198
  def self.build(boxname,options)
199
199
 
200
- options = { "force" => false, "format" => "vagrant", "nogui" => true }.merge(options)
200
+ options = { "force" => false, "format" => "vagrant", "nogui" => false }.merge(options)
201
201
 
202
202
  #Now we have to load the definition (reads definition.rb)
203
203
  load_definition(boxname)
@@ -307,6 +307,7 @@ module Veewee
307
307
  end
308
308
 
309
309
  def self.load_definition(boxname)
310
+
310
311
  if definition_exists?(boxname)
311
312
  definition_file=File.join(@definition_dir,boxname,"definition.rb")
312
313
  begin
@@ -314,7 +315,11 @@ module Veewee
314
315
  rescue LoadError
315
316
  puts "Error loading definition of #{boxname}"
316
317
  exit
317
- end
318
+ end
319
+ else
320
+ puts "Error: definition for basebox '#{boxname}' does not exist."
321
+ list_definitions
322
+ exit
318
323
  end
319
324
  end
320
325
 
@@ -1,3 +1,3 @@
1
1
  module Veewee
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: veewee
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.4
5
+ version: 0.1.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Patrick Debois
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- hash: 4048542714583646501
166
+ hash: 2235806986305417392
167
167
  segments:
168
168
  - 0
169
169
  version: "0"