veewee 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/lib/veewee/command.rb +10 -5
- data/lib/veewee/session.rb +18 -3
- data/lib/veewee/ssh.rb +1 -1
- data/lib/veewee/version.rb +1 -1
- data/templates/CentOS-4.8-i386/postinstall.sh +1 -1
- data/templates/CentOS-5.5-i386/postinstall.sh +1 -1
- data/templates/CentOS-5.5-i386-netboot/postinstall.sh +1 -1
- data/templates/ubuntu-10.04.1-server-i386/postinstall.sh +1 -1
- metadata +2 -3
- data/iso/.gitignore +0 -2
data/Gemfile.lock
CHANGED
data/lib/veewee/command.rb
CHANGED
@@ -21,17 +21,22 @@ module Veewee
|
|
21
21
|
class Command < Vagrant::Command::GroupBase
|
22
22
|
register "basebox","Commands to manage baseboxes"
|
23
23
|
|
24
|
-
desc "templates", "List the currently available
|
24
|
+
desc "templates", "List the currently available basebox templates"
|
25
25
|
def templates
|
26
26
|
Veewee::Session.list_templates
|
27
27
|
end
|
28
28
|
|
29
|
-
desc "define BOXNAME TEMPLATE", "Define a new
|
29
|
+
desc "define BOXNAME TEMPLATE", "Define a new basebox starting from a template"
|
30
30
|
method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "overwrite the definition"
|
31
31
|
def define(boxname, template)
|
32
32
|
Veewee::Session.define(boxname,template,options)
|
33
33
|
end
|
34
34
|
|
35
|
+
desc "undefine BOXNAME", "Removes the definition of a basebox "
|
36
|
+
def undefine(boxname)
|
37
|
+
Veewee::Session.undefine(boxname)
|
38
|
+
end
|
39
|
+
|
35
40
|
desc "build BOXNAME", "Build the box BOXNAME"
|
36
41
|
method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "overwrite the basebox"
|
37
42
|
def build(boxname)
|
@@ -43,17 +48,17 @@ class Command < Vagrant::Command::GroupBase
|
|
43
48
|
Veewee::Session.list_ostypes
|
44
49
|
end
|
45
50
|
|
46
|
-
desc "destroy BOXNAME", "
|
51
|
+
desc "destroy BOXNAME", "Destroys the virtualmachine that was build for a basebox"
|
47
52
|
def destroy(boxname)
|
48
53
|
puts Veewee::Session.destroy_vm(boxname)
|
49
54
|
end
|
50
55
|
|
51
|
-
desc "list", "Lists all defined
|
56
|
+
desc "list", "Lists all defined baseboxes"
|
52
57
|
def list
|
53
58
|
Veewee::Session.list_definitions
|
54
59
|
end
|
55
60
|
|
56
|
-
desc "export [NAME]", "
|
61
|
+
desc "export [NAME]", "Exports the basebox to the vagrant box format"
|
57
62
|
method_options :force => :boolean
|
58
63
|
def export(boxname)
|
59
64
|
if (!boxname.nil?)
|
data/lib/veewee/session.rb
CHANGED
@@ -100,6 +100,7 @@ module Veewee
|
|
100
100
|
name_dir=File.join(@definition_dir,boxname)
|
101
101
|
if File.directory?(name_dir)
|
102
102
|
#TODO: Needs to be more defensive!!
|
103
|
+
puts "Removing definition #{boxname}"
|
103
104
|
FileUtils.rm_rf(name_dir)
|
104
105
|
else
|
105
106
|
puts "Can not undefine , definition #{boxname} does not exist"
|
@@ -131,7 +132,11 @@ module Veewee
|
|
131
132
|
end
|
132
133
|
|
133
134
|
def self.list_definitions
|
134
|
-
puts "
|
135
|
+
puts "The following defined baseboxes exit:"
|
136
|
+
subdirs=Dir.glob("#{@definition_dir}/*")
|
137
|
+
subdirs.each do |sub|
|
138
|
+
puts "- "+File.basename(sub)
|
139
|
+
end
|
135
140
|
end
|
136
141
|
|
137
142
|
def self.clean
|
@@ -156,6 +161,11 @@ module Veewee
|
|
156
161
|
|
157
162
|
question=ask("Download? (Yes/No)") {|q| q.default="No"}
|
158
163
|
if question.downcase == "yes"
|
164
|
+
if !File.exists?(@iso_dir)
|
165
|
+
puts "Creating an iso directory"
|
166
|
+
FileUtils.mkdir(@iso_dir)
|
167
|
+
end
|
168
|
+
|
159
169
|
download_progress(@definition[:iso_src],full_path)
|
160
170
|
else
|
161
171
|
puts "You have choosen for manual download: "
|
@@ -175,6 +185,10 @@ module Veewee
|
|
175
185
|
load_definition(boxname)
|
176
186
|
|
177
187
|
Veewee::Export.vagrant(boxname,@box_dir,@definition)
|
188
|
+
#vagrant removes the mapping
|
189
|
+
#we need to restore it in order to be able to login again
|
190
|
+
add_ssh_nat_mapping(boxname)
|
191
|
+
|
178
192
|
end
|
179
193
|
|
180
194
|
def self.remove_box(boxname)
|
@@ -637,7 +651,7 @@ module Veewee
|
|
637
651
|
#puts "remove old snapshots"
|
638
652
|
|
639
653
|
for s in (last_good_state+1)..(snapnames.length-1)
|
640
|
-
puts "Removing step [s] snapshot as it is no more valid"
|
654
|
+
puts "Removing step [#{s}] snapshot as it is no more valid"
|
641
655
|
snapshot=vm.find_snapshot(snapnames[s])
|
642
656
|
snapshot.destroy
|
643
657
|
#puts snapshot
|
@@ -651,7 +665,8 @@ module Veewee
|
|
651
665
|
sleep 2
|
652
666
|
#TODO:Restore snapshot!!!
|
653
667
|
vm.start
|
654
|
-
|
668
|
+
sleep 2
|
669
|
+
puts "Starting machine"
|
655
670
|
end
|
656
671
|
|
657
672
|
#puts "last good state #{last_good_state}"
|
data/lib/veewee/ssh.rb
CHANGED
@@ -8,7 +8,7 @@ module Veewee
|
|
8
8
|
options=defaults.merge(options)
|
9
9
|
|
10
10
|
puts
|
11
|
-
puts "
|
11
|
+
puts "Waiting for ssh login with user #{options[:user]} to sshd on port => #{options[:port]} to work"
|
12
12
|
|
13
13
|
begin
|
14
14
|
Timeout::timeout(options[:timeout]) do
|
data/lib/veewee/version.rb
CHANGED
@@ -33,7 +33,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
|
|
33
33
|
cd /tmp
|
34
34
|
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
|
35
35
|
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
|
36
|
-
sh /mnt/VBoxLinuxAdditions
|
36
|
+
sh /mnt/VBoxLinuxAdditions.run
|
37
37
|
umount /mnt
|
38
38
|
|
39
39
|
rm VBoxGuestAdditions_$VBOX_VERSION.iso
|
@@ -33,7 +33,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
|
|
33
33
|
cd /tmp
|
34
34
|
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
|
35
35
|
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
|
36
|
-
sh /mnt/VBoxLinuxAdditions
|
36
|
+
sh /mnt/VBoxLinuxAdditions.run
|
37
37
|
umount /mnt
|
38
38
|
|
39
39
|
rm VBoxGuestAdditions_$VBOX_VERSION.iso
|
@@ -33,7 +33,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
|
|
33
33
|
cd /tmp
|
34
34
|
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
|
35
35
|
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
|
36
|
-
sh /mnt/VBoxLinuxAdditions
|
36
|
+
sh /mnt/VBoxLinuxAdditions.run
|
37
37
|
umount /mnt
|
38
38
|
|
39
39
|
rm VBoxGuestAdditions_$VBOX_VERSION.iso
|
@@ -36,7 +36,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
|
|
36
36
|
cd /tmp
|
37
37
|
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
|
38
38
|
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
|
39
|
-
sh /mnt/VBoxLinuxAdditions
|
39
|
+
sh /mnt/VBoxLinuxAdditions.run
|
40
40
|
umount /mnt
|
41
41
|
|
42
42
|
rm VBoxGuestAdditions_$VBOX_VERSION.iso
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: veewee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Patrick Debois
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- README.md
|
110
110
|
- Rakefile
|
111
111
|
- bin/veewee
|
112
|
-
- iso/.gitignore
|
113
112
|
- lib/vagrant_init.rb
|
114
113
|
- lib/veewee.rb
|
115
114
|
- lib/veewee/command.rb
|
@@ -164,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
163
|
requirements:
|
165
164
|
- - ">="
|
166
165
|
- !ruby/object:Gem::Version
|
167
|
-
hash:
|
166
|
+
hash: 4379394221836518214
|
168
167
|
segments:
|
169
168
|
- 0
|
170
169
|
version: "0"
|
data/iso/.gitignore
DELETED