boxgrinder-ubuntu-plugin 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/boxgrinder-ubuntu-plugin.rb +11 -7
- metadata +1 -1
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'rake'
|
|
6
6
|
require 'jeweler'
|
7
7
|
Jeweler::Tasks.new do |gem|
|
8
8
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
9
|
-
gem.version = '0.1'
|
9
|
+
gem.version = '0.1.1'
|
10
10
|
gem.name = "boxgrinder-ubuntu-plugin"
|
11
11
|
gem.homepage = "http://github.com/rubiojr/boxgrinder-ubuntu-plugin"
|
12
12
|
gem.license = "MIT"
|
@@ -6,7 +6,7 @@ module BoxGrinder
|
|
6
6
|
class UbuntuPlugin < BasePlugin
|
7
7
|
def after_init
|
8
8
|
register_deliverable(
|
9
|
-
:disk => "#{@appliance_config.name}-sda.
|
9
|
+
:disk => "#{@appliance_config.name}-sda.qcow2"
|
10
10
|
)
|
11
11
|
register_supported_os('ubuntu', ["natty"])
|
12
12
|
end
|
@@ -16,7 +16,7 @@ module BoxGrinder
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def validate
|
19
|
-
set_default_config_value('format', '
|
19
|
+
set_default_config_value('format', 'qcow2')
|
20
20
|
end
|
21
21
|
|
22
22
|
def create_files_map
|
@@ -54,19 +54,24 @@ module BoxGrinder
|
|
54
54
|
if create_files_map
|
55
55
|
extra_args << "--copy #{@dir.tmp + '/filelist'}"
|
56
56
|
end
|
57
|
-
extra_args << '--quiet'
|
58
57
|
extra_args << "--part #{create_partitions_file}"
|
59
58
|
extra_args << "--rootpass #{@appliance_config.os.password}"
|
59
|
+
if ENV["BOXGRINDER_DEBUG_VMBUILDER"]
|
60
|
+
extra_args << "--debug"
|
61
|
+
else
|
62
|
+
extra_args << '--quiet'
|
63
|
+
end
|
64
|
+
|
60
65
|
begin
|
61
66
|
@exec_helper.execute "vmbuilder kvm ubuntu #{extra_args.join(' ')} --suite #{@appliance_config.os.version} #{pkgs.join(" ")} --arch #{arch} -t '#{@dir.tmp}' -d '#{@dir.base}/out' --mem #{@appliance_config.hardware.memory} --cpus #{@appliance_config.hardware.cpus}"
|
62
67
|
#
|
63
68
|
# Move resulting disk image to the plugin output dir
|
64
69
|
#
|
65
70
|
dsource = Dir["#{@dir.base}/out/*.qcow2"].first
|
66
|
-
ddest = "#{@dir.base}/tmp/#{@appliance_config.name}-sda.
|
71
|
+
ddest = "#{@dir.base}/tmp/#{@appliance_config.name}-sda.qcow2"
|
67
72
|
@log.debug "Moving qcow2 disk image from #{dsource} to #{ddest}"
|
68
|
-
|
69
|
-
@
|
73
|
+
FileUtils.mv dsource, ddest
|
74
|
+
@log.debug "Ubuntu appliance ready"
|
70
75
|
rescue => e
|
71
76
|
ensure
|
72
77
|
#
|
@@ -77,7 +82,6 @@ module BoxGrinder
|
|
77
82
|
#
|
78
83
|
if not ENV["BOXGRINDER_DEBUG_NOCLEAN"]
|
79
84
|
@log.debug "Cleaning tmp/work directories"
|
80
|
-
FileUtils.rm_rf "#{@dir.tmp}" if File.exist? "#{@dir.tmp}"
|
81
85
|
FileUtils.rm_rf "#{@dir.base}/out" if File.exist? "#{@dir.base}/out"
|
82
86
|
end
|
83
87
|
end
|