boxgrinder-build 0.9.8 → 0.10.0
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/CHANGELOG +15 -0
- data/Manifest +7 -22
- data/Rakefile +3 -1
- data/bin/boxgrinder-build +1 -1
- data/boxgrinder-build.gemspec +17 -13
- data/integ/appliances/jeos-centos6.appl +4 -0
- data/lib/boxgrinder-build/appliance.rb +61 -23
- data/lib/boxgrinder-build/helpers/ec2-helper.rb +18 -0
- data/lib/boxgrinder-build/helpers/linux-helper.rb +41 -2
- data/lib/boxgrinder-build/helpers/plugin-helper.rb +3 -0
- data/lib/boxgrinder-build/helpers/s3-helper.rb +18 -0
- data/lib/boxgrinder-build/helpers/sftp-helper.rb +124 -0
- data/lib/boxgrinder-build/managers/plugin-manager.rb +5 -3
- data/lib/boxgrinder-build/plugins/base-plugin.rb +2 -22
- data/lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb +26 -15
- data/lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb +2 -1
- data/lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb +164 -0
- data/lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb +313 -0
- data/lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb +2 -1
- data/lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb +133 -0
- data/lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb +15 -2
- data/lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb +20 -106
- data/lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb +3 -3
- data/lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb +2 -1
- data/lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb +2 -1
- data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb +6 -64
- data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb +2 -1
- data/lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb +1 -2
- data/lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb +15 -1
- data/lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb +2 -1
- data/lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb +58 -0
- data/lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb +2 -1
- data/rubygem-boxgrinder-build.spec +25 -1
- data/spec/appliance-spec.rb +1 -58
- data/spec/helpers/linux-helper-spec.rb +70 -0
- data/spec/managers/plugin-manager-spec.rb +4 -13
- data/spec/plugins/delivery/ebs/ebs-plugin-spec.rb +6 -14
- data/spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb +5 -6
- data/spec/plugins/delivery/libvirt/libvirt-plugin-spec.rb +300 -0
- data/spec/plugins/delivery/libvirt/libvirt_modified.xml +25 -0
- data/spec/plugins/delivery/libvirt/libvirt_modify.sh +18 -0
- data/spec/plugins/delivery/libvirt/libvirt_test.xml +24 -0
- data/spec/plugins/delivery/local/local-plugin-spec.rb +3 -6
- data/spec/plugins/delivery/openstack/openstack-plugin-spec.rb +103 -0
- data/spec/plugins/delivery/s3/s3-plugin-spec.rb +16 -5
- data/spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb +2 -80
- data/spec/plugins/platform/ec2/ec2-plugin-spec.rb +15 -1
- data/spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb +6 -6
- data/spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb +90 -0
- data/spec/plugins/platform/vmware/vmware-plugin-spec.rb +5 -9
- data/spec/rspec-plugin-helper.rb +47 -0
- metadata +54 -10
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
v0.10.0
|
|
2
|
+
|
|
3
|
+
* [BGBUILD-313] boxgrinder build fails to build ec2 image if ec2-user already exists
|
|
4
|
+
* [BGBUILD-318] Add support for us-west-2 region
|
|
5
|
+
* [BGBUILD-308] Clearer error message when unrecognised file extension is used
|
|
6
|
+
* [BGBUILD-322] Allow selection of kernel and ramdisk for ec2 and ebs plugins
|
|
7
|
+
* [BGBUILD-302] Add support for VirtualPC platform
|
|
8
|
+
* [BGBUILD-195] Add support for OpenStack
|
|
9
|
+
* [BGBUILD-304] Standarize plugin callbacks
|
|
10
|
+
* [BGBUILD-325] Remove kickstart support
|
|
11
|
+
* [BGBUILD-323] Invalid kernel version recognition makes recreating initrd impossible
|
|
12
|
+
* [BGBUILD-326] Ensure building from root directory is successful
|
|
13
|
+
* [BGBUILD-211] Support for registering appliances with libvirt
|
|
14
|
+
* [BGBUILD-331] Add support for sa-east-1 EC2 region
|
|
15
|
+
|
|
1
16
|
v0.9.8
|
|
2
17
|
|
|
3
18
|
* [BGBUILD-312] Only use root privileges when necessary
|
data/Manifest
CHANGED
|
@@ -8,6 +8,7 @@ boxgrinder-build.gemspec
|
|
|
8
8
|
integ/appliances/gnome-fedora.appl
|
|
9
9
|
integ/appliances/jeos-centos5-files.appl
|
|
10
10
|
integ/appliances/jeos-centos5.appl
|
|
11
|
+
integ/appliances/jeos-centos6.appl
|
|
11
12
|
integ/appliances/jeos-f15.appl
|
|
12
13
|
integ/appliances/jeos-f16-files.appl
|
|
13
14
|
integ/appliances/jeos-f16.appl
|
|
@@ -41,11 +42,15 @@ lib/boxgrinder-build/helpers/package-helper.rb
|
|
|
41
42
|
lib/boxgrinder-build/helpers/plugin-helper.rb
|
|
42
43
|
lib/boxgrinder-build/helpers/qemu.wrapper
|
|
43
44
|
lib/boxgrinder-build/helpers/s3-helper.rb
|
|
45
|
+
lib/boxgrinder-build/helpers/sftp-helper.rb
|
|
44
46
|
lib/boxgrinder-build/managers/plugin-manager.rb
|
|
45
47
|
lib/boxgrinder-build/plugins/base-plugin.rb
|
|
46
48
|
lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb
|
|
47
49
|
lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb
|
|
50
|
+
lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb
|
|
51
|
+
lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb
|
|
48
52
|
lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb
|
|
53
|
+
lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb
|
|
49
54
|
lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb
|
|
50
55
|
lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem
|
|
51
56
|
lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb
|
|
@@ -67,6 +72,7 @@ lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0
|
|
|
67
72
|
lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst
|
|
68
73
|
lib/boxgrinder-build/plugins/platform/ec2/src/rc_local
|
|
69
74
|
lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb
|
|
75
|
+
lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb
|
|
70
76
|
lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise
|
|
71
77
|
lib/boxgrinder-build/plugins/platform/vmware/src/README-personal
|
|
72
78
|
lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk
|
|
@@ -81,25 +87,4 @@ spec/helpers/image-helper-spec.rb
|
|
|
81
87
|
spec/helpers/linux-helper-spec.rb
|
|
82
88
|
spec/helpers/package-helper-spec.rb
|
|
83
89
|
spec/helpers/plugin-helper-spec.rb
|
|
84
|
-
spec/helpers/s3-helper-
|
|
85
|
-
spec/managers/plugin-manager-spec.rb
|
|
86
|
-
spec/plugins/base-plugin-spec.rb
|
|
87
|
-
spec/plugins/delivery/ebs/ebs-plugin-spec.rb
|
|
88
|
-
spec/plugins/delivery/ebs/ebs.yaml
|
|
89
|
-
spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb
|
|
90
|
-
spec/plugins/delivery/local/local-plugin-spec.rb
|
|
91
|
-
spec/plugins/delivery/s3/s3-plugin-spec.rb
|
|
92
|
-
spec/plugins/delivery/sftp/sftp-plugin-spec.rb
|
|
93
|
-
spec/plugins/os/centos/centos-plugin-spec.rb
|
|
94
|
-
spec/plugins/os/fedora/fedora-plugin-spec.rb
|
|
95
|
-
spec/plugins/os/rhel/rhel-plugin-spec.rb
|
|
96
|
-
spec/plugins/os/rpm-based/kickstart-spec.rb
|
|
97
|
-
spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb
|
|
98
|
-
spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb
|
|
99
|
-
spec/plugins/os/rpm-based/src/jeos-f13-plain.ks
|
|
100
|
-
spec/plugins/os/rpm-based/src/jeos-f13-without-version.ks
|
|
101
|
-
spec/plugins/os/rpm-based/src/jeos-f13.ks
|
|
102
|
-
spec/plugins/os/sl/sl-plugin-spec.rb
|
|
103
|
-
spec/plugins/platform/ec2/ec2-plugin-spec.rb
|
|
104
|
-
spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb
|
|
105
|
-
spec/plugins/platform/vmware/vmware-plugin-spec.rb
|
|
90
|
+
spec/helpers/s3-helper-spe
|
data/Rakefile
CHANGED
|
@@ -30,7 +30,9 @@ Echoe.new("boxgrinder-build") do |p|
|
|
|
30
30
|
"boxgrinder-core ~>0.3.0",
|
|
31
31
|
'aws-sdk >=1.1.1', # EBS and S3
|
|
32
32
|
'net-sftp', 'net-ssh', 'progressbar', # SFTP
|
|
33
|
-
'rest-client' # ElasticHosts
|
|
33
|
+
'rest-client', # ElasticHosts
|
|
34
|
+
'nokogiri',
|
|
35
|
+
'builder'
|
|
34
36
|
]
|
|
35
37
|
end
|
|
36
38
|
|
data/bin/boxgrinder-build
CHANGED
data/boxgrinder-build.gemspec
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
|
-
s.name =
|
|
5
|
-
s.version = "0.
|
|
4
|
+
s.name = "boxgrinder-build"
|
|
5
|
+
s.version = "0.10.0"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["Marek Goldmann"]
|
|
9
|
-
s.date =
|
|
10
|
-
s.
|
|
11
|
-
s.
|
|
12
|
-
s.email = %q{info@boxgrinder.org}
|
|
9
|
+
s.date = "2011-12-19"
|
|
10
|
+
s.description = "A tool for creating appliances from simple plain text files for various virtual environments."
|
|
11
|
+
s.email = "info@boxgrinder.org"
|
|
13
12
|
s.executables = ["boxgrinder-build"]
|
|
14
|
-
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "bin/boxgrinder-build", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/aws-helper.rb", "lib/boxgrinder-build/helpers/ec2-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/helpers/s3-helper.rb", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb"]
|
|
15
|
-
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "bin/boxgrinder-build", "
|
|
16
|
-
s.homepage =
|
|
13
|
+
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "bin/boxgrinder-build", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/aws-helper.rb", "lib/boxgrinder-build/helpers/ec2-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/helpers/s3-helper.rb", "lib/boxgrinder-build/helpers/sftp-helper.rb", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb"]
|
|
14
|
+
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "bin/boxgrinder-build", "integ/appliances/gnome-fedora.appl", "integ/appliances/jeos-centos5-files.appl", "integ/appliances/jeos-centos5.appl", "integ/appliances/jeos-centos6.appl", "integ/appliances/jeos-f15.appl", "integ/appliances/jeos-f16-files.appl", "integ/appliances/jeos-f16.appl", "integ/appliances/modular/_hardware_cpus.appl", "integ/appliances/modular/_hardware_memory.appl", "integ/appliances/modular/_hardware_partitions_home.appl", "integ/appliances/modular/_hardware_partitions_root.appl", "integ/appliances/modular/_os_password.appl", "integ/appliances/modular/_packages_groups_base.appl", "integ/appliances/modular/_packages_groups_core.appl", "integ/appliances/modular/_packages_squid.appl", "integ/appliances/modular/_packages_utils.appl", "integ/appliances/modular/_repos_boxgrinder_permanent_noarch.appl", "integ/appliances/modular/_repos_testlocal_ephemeral_noarch.appl", "integ/appliances/modular/_test_base.appl", "integ/appliances/modular/modular.appl", "integ/packages/ephemeral-repo-test-0.1-1.noarch.rpm", "integ/packages/local-repo-test.spec", "integ/spec/files-spec.rb", "integ/spec/jeos-spec.rb", "integ/spec/modular-spec.rb", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/aws-helper.rb", "lib/boxgrinder-build/helpers/ec2-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/helpers/s3-helper.rb", "lib/boxgrinder-build/helpers/sftp-helper.rb", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb", "lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb", "rubygem-boxgrinder-build.spec", "spec/appliance-spec.rb", "spec/helpers/augeas-helper-spec.rb", "spec/helpers/ec2-helper-spec.rb", "spec/helpers/guestfs-helper-spec.rb", "spec/helpers/image-helper-spec.rb", "spec/helpers/linux-helper-spec.rb", "spec/helpers/package-helper-spec.rb", "spec/helpers/plugin-helper-spec.rb", "spec/helpers/s3-helper-spec.rb", "spec/managers/plugin-manager-spec.rb", "spec/plugins/base-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs.yaml", "spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb", "spec/plugins/delivery/libvirt/libvirt-plugin-spec.rb", "spec/plugins/delivery/libvirt/libvirt_modified.xml", "spec/plugins/delivery/libvirt/libvirt_modify.sh", "spec/plugins/delivery/libvirt/libvirt_test.xml", "spec/plugins/delivery/local/local-plugin-spec.rb", "spec/plugins/delivery/openstack/openstack-plugin-spec.rb", "spec/plugins/delivery/s3/s3-plugin-spec.rb", "spec/plugins/delivery/sftp/sftp-plugin-spec.rb", "spec/plugins/os/centos/centos-plugin-spec.rb", "spec/plugins/os/fedora/fedora-plugin-spec.rb", "spec/plugins/os/rhel/rhel-plugin-spec.rb", "spec/plugins/os/rpm-based/kickstart-spec.rb", "spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb", "spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb", "spec/plugins/os/rpm-based/src/jeos-f13-plain.ks", "spec/plugins/os/rpm-based/src/jeos-f13-without-version.ks", "spec/plugins/os/rpm-based/src/jeos-f13.ks", "spec/plugins/os/sl/sl-plugin-spec.rb", "spec/plugins/platform/ec2/ec2-plugin-spec.rb", "spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb", "spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb", "spec/plugins/platform/vmware/vmware-plugin-spec.rb", "spec/rspec-plugin-helper.rb", "boxgrinder-build.gemspec"]
|
|
15
|
+
s.homepage = "http://boxgrinder.org/"
|
|
17
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Boxgrinder-build", "--main", "README.md"]
|
|
18
17
|
s.require_paths = ["lib"]
|
|
19
|
-
s.rubyforge_project =
|
|
20
|
-
s.rubygems_version =
|
|
21
|
-
s.summary =
|
|
18
|
+
s.rubyforge_project = "BoxGrinder Build"
|
|
19
|
+
s.rubygems_version = "1.8.11"
|
|
20
|
+
s.summary = "A tool for creating appliances from simple plain text files for various virtual environments."
|
|
22
21
|
|
|
23
22
|
if s.respond_to? :specification_version then
|
|
24
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
25
23
|
s.specification_version = 3
|
|
26
24
|
|
|
27
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
@@ -31,6 +29,8 @@ Gem::Specification.new do |s|
|
|
|
31
29
|
s.add_runtime_dependency(%q<net-ssh>, [">= 0"])
|
|
32
30
|
s.add_runtime_dependency(%q<progressbar>, [">= 0"])
|
|
33
31
|
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
|
32
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
|
33
|
+
s.add_runtime_dependency(%q<builder>, [">= 0"])
|
|
34
34
|
else
|
|
35
35
|
s.add_dependency(%q<boxgrinder-core>, ["~> 0.3.0"])
|
|
36
36
|
s.add_dependency(%q<aws-sdk>, [">= 1.1.1"])
|
|
@@ -38,6 +38,8 @@ Gem::Specification.new do |s|
|
|
|
38
38
|
s.add_dependency(%q<net-ssh>, [">= 0"])
|
|
39
39
|
s.add_dependency(%q<progressbar>, [">= 0"])
|
|
40
40
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
|
41
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
|
42
|
+
s.add_dependency(%q<builder>, [">= 0"])
|
|
41
43
|
end
|
|
42
44
|
else
|
|
43
45
|
s.add_dependency(%q<boxgrinder-core>, ["~> 0.3.0"])
|
|
@@ -46,5 +48,7 @@ Gem::Specification.new do |s|
|
|
|
46
48
|
s.add_dependency(%q<net-ssh>, [">= 0"])
|
|
47
49
|
s.add_dependency(%q<progressbar>, [">= 0"])
|
|
48
50
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
|
51
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
|
52
|
+
s.add_dependency(%q<builder>, [">= 0"])
|
|
49
53
|
end
|
|
50
54
|
end
|
|
@@ -37,26 +37,14 @@ module BoxGrinder
|
|
|
37
37
|
@log = options[:log] || LogHelper.new(:level => @config.log_level)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
# TODO: this is not very clean...
|
|
41
40
|
def read_definition
|
|
42
|
-
# first try to read as appliance definition file
|
|
43
41
|
appliance_helper = ApplianceDefinitionHelper.new(:log => @log)
|
|
44
42
|
appliance_helper.read_definitions(@appliance_definition)
|
|
45
43
|
|
|
46
44
|
appliance_configs = appliance_helper.appliance_configs
|
|
47
45
|
appliance_config = appliance_configs.first
|
|
48
46
|
|
|
49
|
-
if appliance_config.nil?
|
|
50
|
-
# Still nothing? Then try to read OS plugin specific format...
|
|
51
|
-
PluginManager.instance.plugins[:os].each_value do |info|
|
|
52
|
-
plugin = info[:class].new
|
|
53
|
-
appliance_config = plugin.read_file(@appliance_definition) if plugin.respond_to?(:read_file)
|
|
54
|
-
break unless appliance_config.nil?
|
|
55
|
-
end
|
|
56
|
-
appliance_configs = [appliance_config]
|
|
57
|
-
|
|
58
|
-
raise ValidationError, "Couldn't read appliance definition file: #{File.basename(@appliance_definition)}." if appliance_config.nil?
|
|
59
|
-
end
|
|
47
|
+
raise ValidationError, "Ensure your appliance definition file has a '.appl' extension: #{File.basename(@appliance_definition)}." if appliance_config.nil?
|
|
60
48
|
|
|
61
49
|
appliance_config_helper = ApplianceConfigHelper.new(appliance_configs)
|
|
62
50
|
@appliance_config = appliance_config_helper.merge(appliance_config.clone.init_arch).initialize_paths
|
|
@@ -65,8 +53,8 @@ module BoxGrinder
|
|
|
65
53
|
def validate_definition
|
|
66
54
|
os_plugin = PluginManager.instance.plugins[:os][@appliance_config.os.name.to_sym]
|
|
67
55
|
|
|
68
|
-
raise "
|
|
69
|
-
raise "
|
|
56
|
+
raise "Unsupported operating system selected: #{@appliance_config.os.name}. Make sure you have installed right operating system plugin, see http://boxgrinder.org/tutorials/boxgrinder-build-plugins/#Operating_system_plugins. Supported OSes are: #{PluginManager.instance.plugins[:os].keys.join(", ")}" if os_plugin.nil?
|
|
57
|
+
raise "Unsupported operating system version selected: #{@appliance_config.os.version}. Supported versions are: #{os_plugin[:versions].join(", ")}" unless @appliance_config.os.version.nil? or os_plugin[:versions].include?(@appliance_config.os.version)
|
|
70
58
|
end
|
|
71
59
|
|
|
72
60
|
# Here we initialize all required plugins and create a plugin chain.
|
|
@@ -75,23 +63,51 @@ module BoxGrinder
|
|
|
75
63
|
@plugin_chain = []
|
|
76
64
|
|
|
77
65
|
os_plugin, os_plugin_info = PluginManager.instance.initialize_plugin(:os, @appliance_config.os.name.to_sym)
|
|
78
|
-
os_plugin
|
|
79
|
-
|
|
80
|
-
@plugin_chain << {:plugin => os_plugin, :param => @appliance_definition}
|
|
66
|
+
initialize_plugin(os_plugin, os_plugin_info)
|
|
81
67
|
|
|
82
68
|
if platform_selected?
|
|
83
69
|
platform_plugin, platform_plugin_info = PluginManager.instance.initialize_plugin(:platform, @config.platform)
|
|
84
|
-
platform_plugin
|
|
85
|
-
|
|
86
|
-
@plugin_chain << {:plugin => platform_plugin}
|
|
70
|
+
initialize_plugin(platform_plugin, platform_plugin_info)
|
|
87
71
|
end
|
|
88
72
|
|
|
89
73
|
if delivery_selected?
|
|
90
74
|
delivery_plugin, delivery_plugin_info = PluginManager.instance.initialize_plugin(:delivery, @config.delivery)
|
|
91
|
-
|
|
75
|
+
# Here we need to specify additionaly the type of the plugin, as some delivery plugins
|
|
76
|
+
# can have multiple types of delivery implemented. See s3-plugin.rb for example.
|
|
77
|
+
initialize_plugin(delivery_plugin, delivery_plugin_info, :type => @config.delivery)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
92
80
|
|
|
93
|
-
|
|
81
|
+
# Initializes the plugin by executing init, after_init, validate and after_validate methods.
|
|
82
|
+
#
|
|
83
|
+
# We can be sure only for init method because it is implemented internally in base-plugin.rb,
|
|
84
|
+
# for all other methods we need to check if they exist.
|
|
85
|
+
def initialize_plugin(plugin, plugin_info, options = {})
|
|
86
|
+
options = {
|
|
87
|
+
:log => @log
|
|
88
|
+
}.merge(options)
|
|
89
|
+
|
|
90
|
+
unless @plugin_chain.empty?
|
|
91
|
+
options.merge!(:previous_plugin => @plugin_chain.last[:plugin])
|
|
94
92
|
end
|
|
93
|
+
|
|
94
|
+
plugin.init(@config, @appliance_config, plugin_info, options)
|
|
95
|
+
|
|
96
|
+
# Execute callbacks if implemented
|
|
97
|
+
#
|
|
98
|
+
# Order is very important
|
|
99
|
+
[:after_init, :validate, :after_validate].each do |callback|
|
|
100
|
+
plugin.send(callback) if plugin.respond_to?(callback)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
param = nil
|
|
104
|
+
|
|
105
|
+
# For operating system plugins we need to inject appliance definition.
|
|
106
|
+
if plugin_info[:type] == :os
|
|
107
|
+
param = @appliance_definition
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@plugin_chain << {:plugin => plugin, :param => param}
|
|
95
111
|
end
|
|
96
112
|
|
|
97
113
|
def remove_old_builds
|
|
@@ -105,6 +121,24 @@ module BoxGrinder
|
|
|
105
121
|
@plugin_chain.each { |p| execute_plugin(p[:plugin], p[:param]) }
|
|
106
122
|
end
|
|
107
123
|
|
|
124
|
+
# This creates the appliance by executing the plugin chain.
|
|
125
|
+
#
|
|
126
|
+
# Definition is read and validated. Afterwards a plugin chain is created
|
|
127
|
+
# and every plugin in the chain is initialized and validated. The next step
|
|
128
|
+
# is the execution of the plugin chain, step by step.
|
|
129
|
+
#
|
|
130
|
+
# Below you can find the whole process of bootstraping a plugin.
|
|
131
|
+
#
|
|
132
|
+
# Call Scope
|
|
133
|
+
# ------------------------------------------
|
|
134
|
+
# initialize required, internal
|
|
135
|
+
# init required, internal
|
|
136
|
+
# after_init optional, user implemented
|
|
137
|
+
# validate optional, user implemented
|
|
138
|
+
# after_validate optional, user implemented
|
|
139
|
+
# execute required, user implemented
|
|
140
|
+
# after_execute optional, user implemented
|
|
141
|
+
#
|
|
108
142
|
def create
|
|
109
143
|
@log.debug "Launching new build..."
|
|
110
144
|
@log.trace "Used configuration: #{@config.to_yaml.gsub(/(\S*(key|account|cert|username|host|password)\S*).*:(.*)/, '\1' + ": <REDACTED>")}"
|
|
@@ -136,8 +170,12 @@ module BoxGrinder
|
|
|
136
170
|
else
|
|
137
171
|
@log.debug "Executing #{plugin.plugin_info[:type]} plugin..."
|
|
138
172
|
|
|
173
|
+
# Actually run the plugin
|
|
139
174
|
param.nil? ? plugin.run : plugin.run(param)
|
|
140
175
|
|
|
176
|
+
# Run after_execute callback, if implemented
|
|
177
|
+
plugin.after_execute if plugin.respond_to?(:after_execute)
|
|
178
|
+
|
|
141
179
|
@log.debug "#{plugin.plugin_info[:type].to_s.capitalize} plugin executed."
|
|
142
180
|
end
|
|
143
181
|
if plugin.plugin_info[:type] == :os
|
|
@@ -169,6 +169,15 @@ module BoxGrinder
|
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
171
|
|
|
172
|
+
'us-west-2' => {
|
|
173
|
+
:endpoint => 'ec2.us-west-2.amazonaws.com',
|
|
174
|
+
:location => 'us-west-2',
|
|
175
|
+
:kernel => {
|
|
176
|
+
:i386 => {:aki => 'aki-dce26fec'},
|
|
177
|
+
:x86_64 => {:aki => 'aki-98e26fa8'}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
|
|
172
181
|
'us-east-1' => {
|
|
173
182
|
:endpoint => 'ec2.amazonaws.com',
|
|
174
183
|
:location => nil,
|
|
@@ -176,7 +185,16 @@ module BoxGrinder
|
|
|
176
185
|
:i386 => {:aki => 'aki-407d9529'},
|
|
177
186
|
:x86_64 => {:aki => 'aki-427d952b'}
|
|
178
187
|
}
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
'sa-east-1' => {
|
|
191
|
+
:endpoint => 'ec2.sa-east-1.amazonaws.com',
|
|
192
|
+
:location => 'sa-east-1',
|
|
193
|
+
:kernel => {
|
|
194
|
+
:i386 => {:aki => 'aki-803ce39d'},
|
|
195
|
+
:x86_64 => {:aki => 'aki-d03ce3cd'}
|
|
179
196
|
}
|
|
197
|
+
}
|
|
180
198
|
}
|
|
181
199
|
end
|
|
182
200
|
end
|
|
@@ -19,6 +19,39 @@
|
|
|
19
19
|
require 'boxgrinder-core/helpers/log-helper'
|
|
20
20
|
|
|
21
21
|
module BoxGrinder
|
|
22
|
+
|
|
23
|
+
# A class tha helps dealing with RPM version numbers
|
|
24
|
+
#
|
|
25
|
+
class RPMVersion
|
|
26
|
+
def split(version)
|
|
27
|
+
version_array = []
|
|
28
|
+
|
|
29
|
+
version.split('-').each do |v|
|
|
30
|
+
v.split('.').each { |nb| version_array << nb }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
version_array
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def compare(v1, v2)
|
|
37
|
+
s1 = split(v1)
|
|
38
|
+
s2 = split(v2)
|
|
39
|
+
|
|
40
|
+
for i in (0..s1.size-1)
|
|
41
|
+
cmp = (s1[i].to_i <=> s2[i].to_i)
|
|
42
|
+
return cmp unless cmp == 0
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
0
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns newest version from the array
|
|
49
|
+
#
|
|
50
|
+
def newest(versions)
|
|
51
|
+
versions.sort { |x,y| compare(x,y) }.last
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
22
55
|
class LinuxHelper
|
|
23
56
|
def initialize(options = {})
|
|
24
57
|
@log = options[:log] || LogHelper.new
|
|
@@ -60,11 +93,14 @@ module BoxGrinder
|
|
|
60
93
|
|
|
61
94
|
def kernel_version(guestfs)
|
|
62
95
|
kernel_versions = guestfs.ls("/lib/modules")
|
|
63
|
-
version = kernel_versions.last
|
|
64
96
|
|
|
97
|
+
# By default use the latest available kernel...
|
|
98
|
+
version = RPMVersion.new.newest(kernel_versions)
|
|
99
|
+
|
|
100
|
+
# ...but prefer xen or PAE kernel over others
|
|
65
101
|
if kernel_versions.size > 1
|
|
66
102
|
kernel_versions.each do |v|
|
|
67
|
-
if v.match(/PAE$/)
|
|
103
|
+
if v.match(/xen$/) or v.match(/PAE$/)
|
|
68
104
|
version = v
|
|
69
105
|
break
|
|
70
106
|
end
|
|
@@ -80,6 +116,9 @@ module BoxGrinder
|
|
|
80
116
|
|
|
81
117
|
def recreate_kernel_image(guestfs, modules = [])
|
|
82
118
|
kernel_version = kernel_version(guestfs)
|
|
119
|
+
|
|
120
|
+
raise "Cannot find valid kernel installs in the appliance. Make sure you have your kernel installed in '/lib/modules'." if kernel_version.nil?
|
|
121
|
+
|
|
83
122
|
kernel_image_name = kernel_image_name(guestfs)
|
|
84
123
|
|
|
85
124
|
if guestfs.exists("/sbin/dracut") != 0
|
|
@@ -25,10 +25,13 @@ require 'boxgrinder-build/plugins/delivery/sftp/sftp-plugin'
|
|
|
25
25
|
require 'boxgrinder-build/plugins/delivery/ebs/ebs-plugin'
|
|
26
26
|
require 'boxgrinder-build/plugins/delivery/local/local-plugin'
|
|
27
27
|
require 'boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin'
|
|
28
|
+
require 'boxgrinder-build/plugins/delivery/openstack/openstack-plugin'
|
|
29
|
+
require 'boxgrinder-build/plugins/delivery/libvirt/libvirt-plugin'
|
|
28
30
|
|
|
29
31
|
require 'boxgrinder-build/plugins/platform/vmware/vmware-plugin'
|
|
30
32
|
require 'boxgrinder-build/plugins/platform/ec2/ec2-plugin'
|
|
31
33
|
require 'boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin'
|
|
34
|
+
require 'boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin'
|
|
32
35
|
|
|
33
36
|
require 'boxgrinder-build/plugins/os/centos/centos-plugin'
|
|
34
37
|
require 'boxgrinder-build/plugins/os/rhel/rhel-plugin'
|
|
@@ -105,6 +105,15 @@ module BoxGrinder
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
|
|
108
|
+
'us-west-2' => {
|
|
109
|
+
:endpoint => 's3-us-west-2.amazonaws.com',
|
|
110
|
+
:location => 'us-west-2',
|
|
111
|
+
:kernel => {
|
|
112
|
+
:i386 => {:aki => 'aki-dce26fec'},
|
|
113
|
+
:x86_64 => {:aki => 'aki-98e26fa8'}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
|
|
108
117
|
'us-east-1' => {
|
|
109
118
|
:endpoint => 's3.amazonaws.com',
|
|
110
119
|
:location => nil,
|
|
@@ -112,6 +121,15 @@ module BoxGrinder
|
|
|
112
121
|
:i386 => {:aki => 'aki-407d9529'},
|
|
113
122
|
:x86_64 => {:aki => 'aki-427d952b'}
|
|
114
123
|
}
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
'sa-east-1' => {
|
|
127
|
+
:endpoint => 's3-sa-east-1.amazonaws.com',
|
|
128
|
+
:location => 'sa-east-1',
|
|
129
|
+
:kernel => {
|
|
130
|
+
:i386 => {:aki => 'aki-803ce39d'},
|
|
131
|
+
:x86_64 => {:aki => 'aki-d03ce3cd'}
|
|
132
|
+
}
|
|
115
133
|
}
|
|
116
134
|
}
|
|
117
135
|
|