multidisk-boxgrinder-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 +11 -10
- data/lib/multidisk-boxgrinder-plugin.rb +37 -2
- metadata +53 -22
- data/lib/multidisk-boxgrinder-plugin/multidisk.rb +0 -34
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 = "multidisk-boxgrinder-plugin"
|
11
11
|
gem.homepage = "http://github.com/rubiojr/multidisk-boxgrinder-plugin"
|
12
12
|
gem.license = "MIT"
|
@@ -15,6 +15,7 @@ Jeweler::Tasks.new do |gem|
|
|
15
15
|
gem.email = "rubiojr@frameos.org"
|
16
16
|
gem.authors = ["Sergio Rubio"]
|
17
17
|
# dependencies defined in Gemfile
|
18
|
+
gem.add_dependency "boxgrinder-build", ">= 0.10"
|
18
19
|
end
|
19
20
|
Jeweler::RubygemsDotOrgTasks.new
|
20
21
|
|
@@ -27,12 +28,12 @@ end
|
|
27
28
|
|
28
29
|
task :default => :build
|
29
30
|
|
30
|
-
require 'rdoc/task'
|
31
|
-
Rake::RDocTask.new do |rdoc|
|
32
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
33
|
-
|
34
|
-
rdoc.rdoc_dir = 'rdoc'
|
35
|
-
rdoc.title = "multidisk-boxgrinder-plugin #{version}"
|
36
|
-
rdoc.rdoc_files.include('README*')
|
37
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
38
|
-
end
|
31
|
+
#require 'rdoc/task'
|
32
|
+
#Rake::RDocTask.new do |rdoc|
|
33
|
+
# version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
34
|
+
#
|
35
|
+
# rdoc.rdoc_dir = 'rdoc'
|
36
|
+
# rdoc.title = "multidisk-boxgrinder-plugin #{version}"
|
37
|
+
# rdoc.rdoc_files.include('README*')
|
38
|
+
# rdoc.rdoc_files.include('lib/**/*.rb')
|
39
|
+
#end
|
@@ -1,4 +1,39 @@
|
|
1
|
-
require '
|
1
|
+
require 'boxgrinder-build/plugins/base-plugin'
|
2
2
|
|
3
|
-
|
3
|
+
module BoxGrinder
|
4
4
|
|
5
|
+
class MultiDiskPlugin < BasePlugin
|
6
|
+
plugin :type => :platform, :name => :multidisk, :full_name => "Multi Disk"
|
7
|
+
|
8
|
+
def after_init
|
9
|
+
register_deliverable(:vmdk_sparse => "#{@appliance_config.name}-sparse.vmdk")
|
10
|
+
register_deliverable(:vmdk_stream => "#{@appliance_config.name}-streamoptimized.vmdk")
|
11
|
+
register_deliverable(:qcow_sparse => "#{@appliance_config.name}-sparse.qcow2")
|
12
|
+
register_deliverable(:qcow_compressed => "#{@appliance_config.name}-compressed.qcow2")
|
13
|
+
end
|
14
|
+
|
15
|
+
def execute
|
16
|
+
@log.info "Converting RAW to multiple disk formats"
|
17
|
+
|
18
|
+
@log.info "Converting to VMDK Sparse using qemu-img..."
|
19
|
+
@exec_helper.execute "qemu-img convert -O vmdk '#{@previous_deliverables.disk}' '#{@deliverables.vmdk_sparse}'"
|
20
|
+
|
21
|
+
@log.info "Converting to QCow2 Sparse using qemu-img..."
|
22
|
+
@exec_helper.execute "qemu-img convert -O qcow2 '#{@previous_deliverables.disk}' '#{@deliverables.qcow_sparse}'"
|
23
|
+
|
24
|
+
@log.info "Converting to QCow2 Compressed Sparse using qemu-img..."
|
25
|
+
@exec_helper.execute "qemu-img convert -c -O qcow2 '#{@previous_deliverables.disk}' '#{@deliverables.qcow_compressed}'"
|
26
|
+
|
27
|
+
if `which VBoxManage`.empty?
|
28
|
+
@log.error "VBoxManage binary not found in your path, skipping VMDK Stream format."
|
29
|
+
else
|
30
|
+
@log.info "Using VBoxManage to convert the image..."
|
31
|
+
@exec_helper.execute "VBoxManage clonehd --format VMDK --variant Stream '#{@deliverables.vmdk_sparse}' '#{@deliverables.vmdk_stream}'"
|
32
|
+
end
|
33
|
+
|
34
|
+
@log.info "Conversions done."
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
metadata
CHANGED
@@ -1,52 +1,83 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: multidisk-boxgrinder-plugin
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Sergio Rubio
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2012-01-27 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: boxgrinder-build
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 31
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 10
|
32
|
+
version: "0.10"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
14
35
|
description: BoxGrinder plugin to convert raw images to VMDK Stream Optimize
|
15
36
|
email: rubiojr@frameos.org
|
16
37
|
executables: []
|
38
|
+
|
17
39
|
extensions: []
|
18
|
-
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
19
42
|
- LICENSE.txt
|
20
43
|
- README.md
|
21
|
-
files:
|
44
|
+
files:
|
22
45
|
- LICENSE.txt
|
23
46
|
- README.md
|
24
47
|
- Rakefile
|
25
48
|
- lib/multidisk-boxgrinder-plugin.rb
|
26
|
-
- lib/multidisk-boxgrinder-plugin/multidisk.rb
|
27
49
|
homepage: http://github.com/rubiojr/multidisk-boxgrinder-plugin
|
28
|
-
licenses:
|
50
|
+
licenses:
|
29
51
|
- MIT
|
30
52
|
post_install_message:
|
31
53
|
rdoc_options: []
|
32
|
-
|
54
|
+
|
55
|
+
require_paths:
|
33
56
|
- lib
|
34
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
58
|
none: false
|
36
|
-
requirements:
|
37
|
-
- -
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
|
40
|
-
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
67
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
46
75
|
requirements: []
|
76
|
+
|
47
77
|
rubyforge_project:
|
48
|
-
rubygems_version: 1.8.
|
78
|
+
rubygems_version: 1.8.15
|
49
79
|
signing_key:
|
50
80
|
specification_version: 3
|
51
81
|
summary: BoxGrinder plugin to convert raw images to VMDK Stream Optimize
|
52
82
|
test_files: []
|
83
|
+
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'boxgrinder-build/plugins/base-plugin'
|
2
|
-
|
3
|
-
module BoxGrinder
|
4
|
-
|
5
|
-
class MultiDiskPlugin < BasePlugin
|
6
|
-
|
7
|
-
def after_init
|
8
|
-
register_deliverable(:vmdk_sparse => "#{@appliance_config.name}-sparse.vmdk")
|
9
|
-
register_deliverable(:vmdk_stream => "#{@appliance_config.name}-streamoptimized.vmdk")
|
10
|
-
register_deliverable(:qcow_sparse => "#{@appliance_config.name}-sparse.qcow2")
|
11
|
-
register_deliverable(:qcow_compressed => "#{@appliance_config.name}-compressed.qcow2")
|
12
|
-
end
|
13
|
-
|
14
|
-
def execute
|
15
|
-
@log.info "Converting RAW to multiple disk formats"
|
16
|
-
|
17
|
-
@log.info "Converting to VMDK Sparse using qemu-img..."
|
18
|
-
@exec_helper.execute "qemu-img convert -O vmdk '#{@previous_deliverables.disk}' '#{@deliverables.vmdk_sparse}'"
|
19
|
-
|
20
|
-
@log.info "Converting to QCow2 Sparse using qemu-img..."
|
21
|
-
@exec_helper.execute "qemu-img convert -O qcow2 '#{@previous_deliverables.disk}' '#{@deliverables.qcow_sparse}'"
|
22
|
-
|
23
|
-
@log.info "Converting to QCow2 Compressed Sparse using qemu-img..."
|
24
|
-
@exec_helper.execute "qemu-img convert -c -O qcow2 '#{@previous_deliverables.disk}' '#{@deliverables.qcow_compressed}'"
|
25
|
-
|
26
|
-
@log.info "Using VBoxManage to convert the image..."
|
27
|
-
@exec_helper.execute "VBoxManage clonehd --format VMDK --variant Stream '#{@deliverables.vmdk_sparse}' '#{@deliverables.vmdk_stream}'"
|
28
|
-
|
29
|
-
@log.info "Conversions done."
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|