boxgrinder-build 0.9.6 → 0.9.7
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 +5 -0
- data/Manifest +19 -29
- data/boxgrinder-build.gemspec +3 -3
- data/integ/appliances/gnome-fedora.appl +1 -1
- data/integ/appliances/jeos-centos5-files.appl +15 -0
- data/integ/appliances/{jeos-centos.appl → jeos-centos5.appl} +1 -1
- data/integ/appliances/jeos-f15.appl +9 -0
- data/integ/appliances/jeos-f16-files.appl +14 -0
- data/integ/appliances/{_hardware_cpus.appl → modular/_hardware_cpus.appl} +0 -0
- data/integ/appliances/{_hardware_memory.appl → modular/_hardware_memory.appl} +0 -0
- data/integ/appliances/{_hardware_partitions_home.appl → modular/_hardware_partitions_home.appl} +0 -0
- data/integ/appliances/{_hardware_partitions_root.appl → modular/_hardware_partitions_root.appl} +0 -0
- data/integ/appliances/{_os_password.appl → modular/_os_password.appl} +0 -0
- data/integ/appliances/{_packages_groups_base.appl → modular/_packages_groups_base.appl} +0 -0
- data/integ/appliances/{_packages_groups_core.appl → modular/_packages_groups_core.appl} +0 -0
- data/integ/appliances/{_packages_squid.appl → modular/_packages_squid.appl} +0 -0
- data/integ/appliances/{_packages_utils.appl → modular/_packages_utils.appl} +0 -0
- data/integ/appliances/{_repos_boxgrinder_permanent_noarch.appl → modular/_repos_boxgrinder_permanent_noarch.appl} +0 -0
- data/integ/appliances/{_repos_testlocal_ephemeral_noarch.appl → modular/_repos_testlocal_ephemeral_noarch.appl} +0 -0
- data/integ/appliances/{_test_base.appl → modular/_test_base.appl} +0 -0
- data/integ/appliances/{modular.appl → modular/modular.appl} +7 -1
- data/integ/spec/files-spec.rb +73 -0
- data/integ/spec/jeos-spec.rb +14 -4
- data/integ/spec/modular-spec.rb +1 -1
- data/lib/boxgrinder-build/appliance.rb +2 -2
- data/lib/boxgrinder-build/helpers/guestfs-helper.rb +3 -0
- data/lib/boxgrinder-build/helpers/linux-helper.rb +11 -2
- data/lib/boxgrinder-build/plugins/base-plugin.rb +17 -0
- data/lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb +1 -1
- data/lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb +5 -1
- data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb +8 -2
- data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb +1 -1
- data/lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb +18 -4
- data/rubygem-boxgrinder-build.spec +6 -1
- data/spec/helpers/linux-helper-spec.rb +5 -0
- data/spec/plugins/base-plugin-spec.rb +14 -0
- data/spec/plugins/delivery/ebs/ebs-plugin-spec.rb +1 -1
- data/spec/plugins/os/fedora/fedora-plugin-spec.rb +3 -9
- data/spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb +46 -3
- data/spec/plugins/platform/ec2/ec2-plugin-spec.rb +17 -10
- metadata +22 -19
- data/integ/appliances/jeos-fedora.appl +0 -5
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
v0.9.7
|
|
2
|
+
|
|
3
|
+
* [BGBUILD-307] Appliance with swap file fails to build if selected OS is centos
|
|
4
|
+
* [BGBUILD-306] Switch for updates-testing repository for integration tests
|
|
5
|
+
|
|
1
6
|
v0.9.6
|
|
2
7
|
|
|
3
8
|
* [BGBUILD-298] Fedora 16 or newer has networking issue on platforms different than EC2 because of biosdevname not disabled
|
data/Manifest
CHANGED
|
@@ -5,25 +5,28 @@ README.md
|
|
|
5
5
|
Rakefile
|
|
6
6
|
bin/boxgrinder-build
|
|
7
7
|
boxgrinder-build.gemspec
|
|
8
|
-
integ/appliances/_hardware_cpus.appl
|
|
9
|
-
integ/appliances/_hardware_memory.appl
|
|
10
|
-
integ/appliances/_hardware_partitions_home.appl
|
|
11
|
-
integ/appliances/_hardware_partitions_root.appl
|
|
12
|
-
integ/appliances/_os_password.appl
|
|
13
|
-
integ/appliances/_packages_groups_base.appl
|
|
14
|
-
integ/appliances/_packages_groups_core.appl
|
|
15
|
-
integ/appliances/_packages_squid.appl
|
|
16
|
-
integ/appliances/_packages_utils.appl
|
|
17
|
-
integ/appliances/_repos_boxgrinder_permanent_noarch.appl
|
|
18
|
-
integ/appliances/_repos_testlocal_ephemeral_noarch.appl
|
|
19
|
-
integ/appliances/_test_base.appl
|
|
20
8
|
integ/appliances/gnome-fedora.appl
|
|
21
|
-
integ/appliances/jeos-
|
|
9
|
+
integ/appliances/jeos-centos5-files.appl
|
|
10
|
+
integ/appliances/jeos-centos5.appl
|
|
11
|
+
integ/appliances/jeos-f15.appl
|
|
12
|
+
integ/appliances/jeos-f16-files.appl
|
|
22
13
|
integ/appliances/jeos-f16.appl
|
|
23
|
-
integ/appliances/
|
|
24
|
-
integ/appliances/modular.appl
|
|
14
|
+
integ/appliances/modular/_hardware_cpus.appl
|
|
15
|
+
integ/appliances/modular/_hardware_memory.appl
|
|
16
|
+
integ/appliances/modular/_hardware_partitions_home.appl
|
|
17
|
+
integ/appliances/modular/_hardware_partitions_root.appl
|
|
18
|
+
integ/appliances/modular/_os_password.appl
|
|
19
|
+
integ/appliances/modular/_packages_groups_base.appl
|
|
20
|
+
integ/appliances/modular/_packages_groups_core.appl
|
|
21
|
+
integ/appliances/modular/_packages_squid.appl
|
|
22
|
+
integ/appliances/modular/_packages_utils.appl
|
|
23
|
+
integ/appliances/modular/_repos_boxgrinder_permanent_noarch.appl
|
|
24
|
+
integ/appliances/modular/_repos_testlocal_ephemeral_noarch.appl
|
|
25
|
+
integ/appliances/modular/_test_base.appl
|
|
26
|
+
integ/appliances/modular/modular.appl
|
|
25
27
|
integ/packages/ephemeral-repo-test-0.1-1.noarch.rpm
|
|
26
28
|
integ/packages/local-repo-test.spec
|
|
29
|
+
integ/spec/files-spec.rb
|
|
27
30
|
integ/spec/jeos-spec.rb
|
|
28
31
|
integ/spec/modular-spec.rb
|
|
29
32
|
lib/boxgrinder-build.rb
|
|
@@ -86,17 +89,4 @@ spec/plugins/delivery/ebs/ebs.yaml
|
|
|
86
89
|
spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb
|
|
87
90
|
spec/plugins/delivery/local/local-plugin-spec.rb
|
|
88
91
|
spec/plugins/delivery/s3/s3-plugin-spec.rb
|
|
89
|
-
spec/plugins/delivery/sftp/sftp-plugin-
|
|
90
|
-
spec/plugins/os/centos/centos-plugin-spec.rb
|
|
91
|
-
spec/plugins/os/fedora/fedora-plugin-spec.rb
|
|
92
|
-
spec/plugins/os/rhel/rhel-plugin-spec.rb
|
|
93
|
-
spec/plugins/os/rpm-based/kickstart-spec.rb
|
|
94
|
-
spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb
|
|
95
|
-
spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb
|
|
96
|
-
spec/plugins/os/rpm-based/src/jeos-f13-plain.ks
|
|
97
|
-
spec/plugins/os/rpm-based/src/jeos-f13-without-version.ks
|
|
98
|
-
spec/plugins/os/rpm-based/src/jeos-f13.ks
|
|
99
|
-
spec/plugins/os/sl/sl-plugin-spec.rb
|
|
100
|
-
spec/plugins/platform/ec2/ec2-plugin-spec.rb
|
|
101
|
-
spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb
|
|
102
|
-
spec/plugins/platform/vmware/vmware-plugin-spec.rb
|
|
92
|
+
spec/plugins/delivery/sftp/sftp-plugin-
|
data/boxgrinder-build.gemspec
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{boxgrinder-build}
|
|
5
|
-
s.version = "0.9.
|
|
5
|
+
s.version = "0.9.7"
|
|
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 = %q{2011-09-
|
|
9
|
+
s.date = %q{2011-09-10}
|
|
10
10
|
s.default_executable = %q{boxgrinder-build}
|
|
11
11
|
s.description = %q{A tool for creating appliances from simple plain text files for various virtual environments.}
|
|
12
12
|
s.email = %q{info@boxgrinder.org}
|
|
13
13
|
s.executables = ["boxgrinder-build"]
|
|
14
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", "boxgrinder-build.gemspec", "integ/appliances/
|
|
15
|
+
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "bin/boxgrinder-build", "boxgrinder-build.gemspec", "integ/appliances/gnome-fedora.appl", "integ/appliances/jeos-centos5-files.appl", "integ/appliances/jeos-centos5.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/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", "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/local/local-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/vmware/vmware-plugin-spec.rb"]
|
|
16
16
|
s.homepage = %q{http://boxgrinder.org/}
|
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Boxgrinder-build", "--main", "README.md"]
|
|
18
18
|
s.require_paths = ["lib"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: jeos-centos5-files
|
|
2
|
+
os:
|
|
3
|
+
name: centos
|
|
4
|
+
version: 5
|
|
5
|
+
files:
|
|
6
|
+
"/opt":
|
|
7
|
+
- jeos-centos5.appl
|
|
8
|
+
- /etc/yum.repos.d/fedora.repo
|
|
9
|
+
- /etc/sysconfig
|
|
10
|
+
- modular
|
|
11
|
+
"/opt/abc":
|
|
12
|
+
- "http://ftp.tpnet.pl/vol/d1/apache//couchdb/1.0.3/apache-couchdb-1.0.3.tar.gz"
|
|
13
|
+
- "https://raw.github.com/boxgrinder/boxgrinder-build/master/README.md"
|
|
14
|
+
- "ftp://ftp.fu-berlin.de/unix/www/apache/couchdb/1.1.0/apache-couchdb-1.1.0.tar.gz"
|
|
15
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: jeos-f16-files
|
|
2
|
+
appliances:
|
|
3
|
+
- jeos-f16
|
|
4
|
+
files:
|
|
5
|
+
"/opt":
|
|
6
|
+
- jeos-centos5.appl
|
|
7
|
+
- /etc/yum.repos.d/fedora.repo
|
|
8
|
+
- /etc/sysconfig
|
|
9
|
+
- modular
|
|
10
|
+
"/opt/abc":
|
|
11
|
+
- "http://ftp.tpnet.pl/vol/d1/apache//couchdb/1.0.3/apache-couchdb-1.0.3.tar.gz"
|
|
12
|
+
- "https://raw.github.com/boxgrinder/boxgrinder-build/master/README.md"
|
|
13
|
+
- "ftp://ftp.fu-berlin.de/unix/www/apache/couchdb/1.1.0/apache-couchdb-1.1.0.tar.gz"
|
|
14
|
+
|
|
File without changes
|
|
File without changes
|
data/integ/appliances/{_hardware_partitions_home.appl → modular/_hardware_partitions_home.appl}
RENAMED
|
File without changes
|
data/integ/appliances/{_hardware_partitions_root.appl → modular/_hardware_partitions_root.appl}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,6 @@ version: 1
|
|
|
4
4
|
release: 2
|
|
5
5
|
appliances:
|
|
6
6
|
- _test_base
|
|
7
|
-
- jeos-fedora
|
|
8
7
|
post:
|
|
9
8
|
base:
|
|
10
9
|
- "/bin/echo 'true' > /fedora-boxgrinder-test"
|
|
@@ -14,3 +13,10 @@ post:
|
|
|
14
13
|
- "/bin/echo 'true' > /fedora-vmware-boxgrinder-test"
|
|
15
14
|
virtualbox:
|
|
16
15
|
- "/bin/echo 'true' > /fedora-virtualbox-boxgrinder-test"
|
|
16
|
+
os:
|
|
17
|
+
name: fedora
|
|
18
|
+
version: 15
|
|
19
|
+
repos:
|
|
20
|
+
- name: "temp-fedora-updates-testing"
|
|
21
|
+
mirrorlist: "https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f#OS_VERSION#&arch=#BASE_ARCH#"
|
|
22
|
+
ephemeral: true
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2010 Red Hat, Inc.
|
|
3
|
+
#
|
|
4
|
+
# This is free software; you can redistribute it and/or modify it
|
|
5
|
+
# under the terms of the GNU Lesser General Public License as
|
|
6
|
+
# published by the Free Software Foundation; either version 3 of
|
|
7
|
+
# the License, or (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This software is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
12
|
+
# Lesser General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
15
|
+
# License along with this software; if not, write to the Free
|
|
16
|
+
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
17
|
+
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
18
|
+
|
|
19
|
+
require 'rubygems'
|
|
20
|
+
require 'boxgrinder-build/appliance'
|
|
21
|
+
require 'boxgrinder-core/models/config'
|
|
22
|
+
require 'boxgrinder-core/helpers/log-helper'
|
|
23
|
+
require 'boxgrinder-build/helpers/guestfs-helper'
|
|
24
|
+
require 'fileutils'
|
|
25
|
+
|
|
26
|
+
module BoxGrinder
|
|
27
|
+
describe 'BoxGrinder Build' do
|
|
28
|
+
before(:all) do
|
|
29
|
+
# Cleaning up before build
|
|
30
|
+
FileUtils.rm_rf('build/')
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
after(:all) do
|
|
34
|
+
# Cleaning up after build
|
|
35
|
+
FileUtils.rm_rf('build/')
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
before(:each) do
|
|
39
|
+
# Deliver the packaged appliance to CloudFront
|
|
40
|
+
@config = Config.new(:delivery => :cloudfront)
|
|
41
|
+
@log = LogHelper.new(:level => :trace, :type => :stdout)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
after(:each) do
|
|
45
|
+
# Make sure all deliverables really exists
|
|
46
|
+
@appliance.plugin_chain.last[:plugin].deliverables.each_value do |file|
|
|
47
|
+
File.exists?(file).should == true
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
GuestFSHelper.new([@appliance.plugin_chain.first[:plugin].deliverables[:disk]], @appliance.appliance_config, @config, :log => @log ).customize do |guestfs, guestfs_helper|
|
|
51
|
+
# Helper to see what's there
|
|
52
|
+
guestfs.sh('ls -hall')
|
|
53
|
+
guestfs.exists('/opt/jeos-centos5.appl').should == 1
|
|
54
|
+
guestfs.exists('/opt/etc/yum.repos.d/fedora.repo').should == 1
|
|
55
|
+
guestfs.exists('/opt/etc/sysconfig/network').should == 1
|
|
56
|
+
guestfs.exists('/opt/abc/apache-couchdb-1.0.3.tar.gz').should == 1
|
|
57
|
+
guestfs.exists('/opt/abc/README.md').should == 1
|
|
58
|
+
guestfs.exists('/opt/abc/apache-couchdb-1.1.0.tar.gz').should == 1
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
context "Files section" do
|
|
63
|
+
it "should build appliance with files section for Fedora 16" do
|
|
64
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-f16-files.appl", @config, :log => @log).create
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it "should build appliance with files section for CentOS 5" do
|
|
68
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-centos5-files.appl", @config, :log => @log).create
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
data/integ/spec/jeos-spec.rb
CHANGED
|
@@ -50,7 +50,7 @@ module BoxGrinder
|
|
|
50
50
|
|
|
51
51
|
context "operating system plugin" do
|
|
52
52
|
it "should build Fedora JEOS" do
|
|
53
|
-
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-
|
|
53
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-f16.appl", @config, :log => @log).create
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
it "should build Fedora 16 JEOS and create an AMI" do
|
|
@@ -58,15 +58,25 @@ module BoxGrinder
|
|
|
58
58
|
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-f16.appl", @config, :log => @log).create
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
it "should build
|
|
62
|
-
@
|
|
61
|
+
it "should build Fedora 15 JEOS and create an AMI" do
|
|
62
|
+
@config.merge!(:platform => :ec2, :delivery => :ami)
|
|
63
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-f15.appl", @config, :log => @log).create
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it "should build CentOS 5 JEOS" do
|
|
67
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-centos5.appl", @config, :log => @log).create
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it "should build CentOS 5 JEOS and create an AMI" do
|
|
71
|
+
@config.merge!(:platform => :ec2, :delivery => :ami)
|
|
72
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-centos5.appl", @config, :log => @log).create
|
|
63
73
|
end
|
|
64
74
|
end
|
|
65
75
|
|
|
66
76
|
context "platform plugin" do
|
|
67
77
|
it "should create Fedora JEOS appliance and convert it to VMware personal platform" do
|
|
68
78
|
@config.merge!(:platform => :vmware, :platform_config => {'type' => 'personal'})
|
|
69
|
-
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-
|
|
79
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/jeos-f16.appl", @config, :log => @log).create
|
|
70
80
|
end
|
|
71
81
|
end
|
|
72
82
|
end
|
data/integ/spec/modular-spec.rb
CHANGED
|
@@ -56,7 +56,7 @@ module BoxGrinder
|
|
|
56
56
|
context "modular appliances" do
|
|
57
57
|
it "should build modular appliance based on Fedora and convert it to VirtualBox" do
|
|
58
58
|
@config.merge!(:platform => :virtualbox)
|
|
59
|
-
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/modular.appl", @config, :log => @log).create
|
|
59
|
+
@appliance = Appliance.new("#{File.dirname(__FILE__)}/../appliances/modular/modular.appl", @config, :log => @log).create
|
|
60
60
|
|
|
61
61
|
GuestFSHelper.new([@appliance.plugin_chain[1][:plugin].deliverables[:disk]], @appliance.appliance_config, @config, :log => @log ).customize do |guestfs, guestfs_helper|
|
|
62
62
|
guestfs.exists('/fedora-boxgrinder-test').should == 1
|
|
@@ -136,11 +136,11 @@ module BoxGrinder
|
|
|
136
136
|
return
|
|
137
137
|
end
|
|
138
138
|
|
|
139
|
-
@log.debug "Executing #{plugin.plugin_info[:type]} plugin
|
|
139
|
+
@log.debug "Executing #{plugin.plugin_info[:type]} plugin..."
|
|
140
140
|
|
|
141
141
|
param.nil? ? plugin.run : plugin.run(param)
|
|
142
142
|
|
|
143
|
-
@log.debug "
|
|
143
|
+
@log.debug "#{plugin.plugin_info[:type].to_s.capitalize} plugin executed."
|
|
144
144
|
end
|
|
145
145
|
end
|
|
146
146
|
end
|
|
@@ -254,6 +254,9 @@ module BoxGrinder
|
|
|
254
254
|
|
|
255
255
|
partitions = mountable_partitions(device)
|
|
256
256
|
mount_points = LinuxHelper.new(:log => @log).partition_mount_points(@appliance_config.hardware.partitions)
|
|
257
|
+
# https://issues.jboss.org/browse/BGBUILD-307
|
|
258
|
+
# We don't want to mount swap partitions at all...
|
|
259
|
+
mount_points.delete("swap")
|
|
257
260
|
partitions.each_index { |i| mount_partition(partitions[i], mount_points[i], mount_prefix) }
|
|
258
261
|
end
|
|
259
262
|
|
|
@@ -28,6 +28,7 @@ module BoxGrinder
|
|
|
28
28
|
#
|
|
29
29
|
# ['/', '/home'] => ['/', '/home']
|
|
30
30
|
# ['swap', '/', '/home'] => ['/', '/home', 'swap']
|
|
31
|
+
# ['swap', '/', '/home', '/boot'] => ['/', '/boot', '/home', 'swap']
|
|
31
32
|
# ['/tmp-eventlog', '/', '/ubrc', '/tmp-config'] => ['/', '/ubrc', '/tmp-config', '/tmp-eventlog']
|
|
32
33
|
#
|
|
33
34
|
def partition_mount_points(partitions)
|
|
@@ -36,15 +37,23 @@ module BoxGrinder
|
|
|
36
37
|
b_count = b.count('/')
|
|
37
38
|
|
|
38
39
|
if a_count > b_count
|
|
39
|
-
v =
|
|
40
|
+
v = 1
|
|
40
41
|
else
|
|
41
42
|
if a_count < b_count
|
|
42
43
|
v = -1
|
|
43
44
|
else
|
|
44
|
-
|
|
45
|
+
if a.length == b.length
|
|
46
|
+
v = a <=> b
|
|
47
|
+
else
|
|
48
|
+
v = a.length <=> b.length
|
|
49
|
+
end
|
|
45
50
|
end
|
|
46
51
|
end
|
|
47
52
|
|
|
53
|
+
# This forces having swap partition at the end of the disk
|
|
54
|
+
v = 1 if a_count == 0
|
|
55
|
+
v = -1 if b_count == 0
|
|
56
|
+
|
|
48
57
|
v
|
|
49
58
|
end
|
|
50
59
|
end
|
|
@@ -37,6 +37,7 @@ module BoxGrinder
|
|
|
37
37
|
|
|
38
38
|
@deliverables = OpenCascade.new
|
|
39
39
|
@supported_oses = OpenCascade.new
|
|
40
|
+
@supported_platforms = []
|
|
40
41
|
@target_deliverables = OpenCascade.new
|
|
41
42
|
@dir = OpenCascade.new
|
|
42
43
|
end
|
|
@@ -126,6 +127,17 @@ module BoxGrinder
|
|
|
126
127
|
@supported_oses[name] = versions
|
|
127
128
|
end
|
|
128
129
|
|
|
130
|
+
def register_supported_platform(name)
|
|
131
|
+
raise "You can register supported platform only after the plugin is initialized, please initialize the plugin using init method." if @initialized.nil?
|
|
132
|
+
@supported_platforms << name
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def is_supported_platform?
|
|
136
|
+
return true if @supported_platforms.empty?
|
|
137
|
+
return false if @previous_plugin_info[:type] == :platform and !@supported_platforms.include?(@previous_plugin_info[:name])
|
|
138
|
+
true
|
|
139
|
+
end
|
|
140
|
+
|
|
129
141
|
def is_supported_os?
|
|
130
142
|
return true if @supported_oses.empty?
|
|
131
143
|
return false unless !@supported_oses[@appliance_config.os.name].nil? and @supported_oses[@appliance_config.os.name].include?(@appliance_config.os.version)
|
|
@@ -171,6 +183,11 @@ module BoxGrinder
|
|
|
171
183
|
return
|
|
172
184
|
end
|
|
173
185
|
|
|
186
|
+
unless is_supported_platform?
|
|
187
|
+
@log.error "#{@plugin_info[:full_name]} plugin supports following platforms: #{@supported_platforms.join(', ')}. You selected #{@previous_plugin_info[:name]} platform which is not supported by this plugin, sorry."
|
|
188
|
+
return
|
|
189
|
+
end
|
|
190
|
+
|
|
174
191
|
FileUtils.rm_rf @dir.tmp
|
|
175
192
|
FileUtils.mkdir_p @dir.tmp
|
|
176
193
|
|
|
@@ -68,6 +68,8 @@ module BoxGrinder
|
|
|
68
68
|
else
|
|
69
69
|
@plugin_config['PAE'] ? packages << "kernel-PAE" : packages << "kernel"
|
|
70
70
|
end
|
|
71
|
+
|
|
72
|
+
packages << "-grub2" if @appliance_config.os.version >= "16"
|
|
71
73
|
end
|
|
72
74
|
|
|
73
75
|
# Since Fedora 16 by default GRUB2 is used - we remove Legacy GRUB
|
|
@@ -77,6 +79,9 @@ module BoxGrinder
|
|
|
77
79
|
def switch_to_grub2(guestfs, guestfs_helper)
|
|
78
80
|
@log.debug "Switching to GRUB2..."
|
|
79
81
|
guestfs_helper.sh("yum -y remove grub")
|
|
82
|
+
guestfs_helper.sh("yum -y install grub2")
|
|
83
|
+
# Disabling biosdevname in GRUB2
|
|
84
|
+
guestfs.write("/etc/default/grub", "GRUB_CMDLINE_LINUX=\"quiet rhgb biosdevname=0\"\n") if guestfs.exists("/boot/grub2/grub.cfg") != 0
|
|
80
85
|
# We are using only one disk, so this is save
|
|
81
86
|
guestfs.sh("cd / && grub2-install --force #{guestfs.list_devices.first}")
|
|
82
87
|
guestfs.sh("cd / && grub2-mkconfig -o /boot/grub2/grub.cfg")
|
|
@@ -85,7 +90,6 @@ module BoxGrinder
|
|
|
85
90
|
|
|
86
91
|
def disable_biosdevname(guestfs)
|
|
87
92
|
@log.debug "Disabling biosdevname..."
|
|
88
|
-
guestfs.write("/etc/default/grub", "GRUB_CMDLINE_LINUX=\"quiet rhgb biosdevname=0\"\n") if guestfs.exists("/boot/grub2/grub.cfg") != 0
|
|
89
93
|
guestfs.sh('sed -i "s/kernel\(.*\)/kernel\1 biosdevname=0/g" /boot/grub/grub.conf') if guestfs.exists("/boot/grub/grub.conf") != 0
|
|
90
94
|
@log.debug "Biosdevname disabled."
|
|
91
95
|
end
|
|
@@ -21,6 +21,7 @@ require 'boxgrinder-build/plugins/base-plugin'
|
|
|
21
21
|
require 'boxgrinder-build/plugins/os/rpm-based/kickstart'
|
|
22
22
|
require 'boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator'
|
|
23
23
|
require 'boxgrinder-build/helpers/linux-helper'
|
|
24
|
+
require 'boxgrinder-core/errors'
|
|
24
25
|
|
|
25
26
|
module BoxGrinder
|
|
26
27
|
class RPMBasedOSPlugin < BasePlugin
|
|
@@ -357,14 +358,19 @@ module BoxGrinder
|
|
|
357
358
|
else
|
|
358
359
|
@log.trace "Local path detected: '#{f}'."
|
|
359
360
|
|
|
360
|
-
|
|
361
|
+
file_path = (f.match(/^\//) ? f : "#{File.dirname(@appliance_definition_file)}/#{f}")
|
|
362
|
+
|
|
363
|
+
# TODO validate this earlier
|
|
364
|
+
raise ValidationError, "File '#{f}' specified in files section of appliance definition file doesn't exists." unless File.exists?(file_path)
|
|
365
|
+
|
|
366
|
+
local_files << f
|
|
361
367
|
end
|
|
362
368
|
end
|
|
363
369
|
|
|
364
370
|
next if local_files.empty?
|
|
365
371
|
|
|
366
372
|
@log.trace "Tarring files..."
|
|
367
|
-
@exec_helper.execute("tar -cvf /tmp/bg_install_files.tar --wildcards #{local_files.join(' ')}")
|
|
373
|
+
@exec_helper.execute("cd #{File.dirname(@appliance_definition_file)} && tar -cvf /tmp/bg_install_files.tar --wildcards #{local_files.join(' ')}")
|
|
368
374
|
@log.trace "Files tarred."
|
|
369
375
|
|
|
370
376
|
@log.trace "Uploading and unpacking..."
|
|
@@ -98,7 +98,7 @@ module BoxGrinder
|
|
|
98
98
|
def generate_package_list
|
|
99
99
|
packages = []
|
|
100
100
|
for package in @appliance_config.packages
|
|
101
|
-
packages << package unless package.match /^@/
|
|
101
|
+
packages << package unless package.match /^@/ or package.match /^-/
|
|
102
102
|
end
|
|
103
103
|
packages
|
|
104
104
|
end
|
|
@@ -165,22 +165,36 @@ module BoxGrinder
|
|
|
165
165
|
end
|
|
166
166
|
|
|
167
167
|
def upload_rc_local(guestfs)
|
|
168
|
-
@log.debug "Uploading '/etc/rc.local' file..."
|
|
168
|
+
@log.debug "Uploading '/etc/rc.d/rc.local' file..."
|
|
169
169
|
rc_local = Tempfile.new('rc_local')
|
|
170
|
-
|
|
170
|
+
|
|
171
|
+
if guestfs.exists("/etc/rc.d/rc.local") == 1
|
|
172
|
+
# We're appending
|
|
173
|
+
rc_local << guestfs.read_file("/etc/rc.d/rc.local")
|
|
174
|
+
else
|
|
175
|
+
# We're creating new file
|
|
176
|
+
rc_local << "#!/bin/bash\n\n"
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
rc_local << File.read("#{File.dirname(__FILE__)}/src/rc_local")
|
|
171
180
|
rc_local.flush
|
|
172
181
|
|
|
173
|
-
guestfs.upload(rc_local.path, "/etc/rc.local")
|
|
182
|
+
guestfs.upload(rc_local.path, "/etc/rc.d/rc.local")
|
|
174
183
|
|
|
175
184
|
rc_local.close
|
|
176
185
|
|
|
186
|
+
# Fedora 16 doesn't have /etc/rc.local file and we need to
|
|
187
|
+
# enable rc.local compatibility with systemd
|
|
177
188
|
# We need to make sure that network is available when executing rc.local
|
|
178
189
|
if (@appliance_config.os.name == 'fedora' and @appliance_config.os.version >= '16')
|
|
179
190
|
guestfs.cp("/lib/systemd/system/rc-local.service", "/etc/systemd/system/")
|
|
180
191
|
guestfs.sh("sed -i '/^ConditionFileIsExecutable/a After=network.target' /etc/systemd/system/rc-local.service")
|
|
192
|
+
guestfs.sh("systemctl enable rc-local.service")
|
|
193
|
+
guestfs.ln_sf("/etc/rc.d/rc.local", "/etc/rc.local")
|
|
194
|
+
guestfs.chmod(0755, "/etc/rc.d/rc.local")
|
|
181
195
|
end
|
|
182
196
|
|
|
183
|
-
@log.debug "'/etc/rc.local' file uploaded."
|
|
197
|
+
@log.debug "'/etc/rc.d/rc.local' file uploaded."
|
|
184
198
|
end
|
|
185
199
|
|
|
186
200
|
def change_configuration(guestfs_helper)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Summary: A tool for creating appliances from simple plain text files
|
|
7
7
|
Name: rubygem-%{gemname}
|
|
8
|
-
Version: 0.9.
|
|
8
|
+
Version: 0.9.7
|
|
9
9
|
Release: 1%{?dist}
|
|
10
10
|
Group: Development/Languages
|
|
11
11
|
License: LGPLv3+
|
|
@@ -130,6 +130,11 @@ popd
|
|
|
130
130
|
%{gemdir}/doc/%{gemname}-%{version}
|
|
131
131
|
|
|
132
132
|
%changelog
|
|
133
|
+
* Tue Sep 06 2011 Marek Goldmann <mgoldman@redhat.com> - 0.9.7-1
|
|
134
|
+
- Upstream release: 0.9.7
|
|
135
|
+
- [BGBUILD-307] Appliance with swap file fails to build if selected OS is centos
|
|
136
|
+
- [BGBUILD-306] Switch for updates-testing repository for integration tests
|
|
137
|
+
|
|
133
138
|
* Sat Aug 27 2011 Marek Goldmann <mgoldman@redhat.com> - 0.9.6-1
|
|
134
139
|
- Upstream release: 0.9.6
|
|
135
140
|
- [BGBUILD-298] Fedora 16 or newer has networking issue on platforms different than EC2 because of biosdevname not disabled
|
|
@@ -76,6 +76,11 @@ module BoxGrinder
|
|
|
76
76
|
@helper.partition_mount_points(hash).should == ['/', '/home', 'swap']
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
+
it "should return ['/', '/boot', '/home', 'swap']" do
|
|
80
|
+
hash = {'swap' => {"size" => 1}, "/boot" => {"size" => 0.1}, "/"=>{"size"=>2, "type"=>"ext3"}, "/home"=>{"size"=>2, "type"=>"ext3"}}
|
|
81
|
+
@helper.partition_mount_points(hash).should == ['/', '/boot', '/home', 'swap']
|
|
82
|
+
end
|
|
83
|
+
|
|
79
84
|
it "should return ['/', '/ubrc', '/tmp-config', '/tmp-eventlog']" do
|
|
80
85
|
hash = {"/tmp-eventlog"=>{"size"=>0.01, "type"=>"ext3"}, "/"=>{"size"=>2, "type"=>"ext3"}, "/ubrc"=>{"size"=>0.02, "type"=>"ext3"}, "/tmp-config"=>{"size"=>0.26}}
|
|
81
86
|
@helper.partition_mount_points(hash).should == ["/", "/ubrc", "/tmp-config", "/tmp-eventlog"]
|
|
@@ -131,6 +131,20 @@ module BoxGrinder
|
|
|
131
131
|
@log.should_receive(:error).with('Amazon Simple Storage Service (Amazon S3) plugin supports following operating systems: fedora (versions: 12, 13). Your appliance contains fedora 14 operating system which is not supported by this plugin, sorry.')
|
|
132
132
|
@plugin.run
|
|
133
133
|
end
|
|
134
|
+
|
|
135
|
+
it "should fail if platform is not supported" do
|
|
136
|
+
@plugin.instance_variable_set(:@previous_plugin_info, {:type => :platform, :name => :ec2})
|
|
137
|
+
@plugin.register_supported_platform('vmware')
|
|
138
|
+
@log.should_receive(:error).with('Amazon Simple Storage Service (Amazon S3) plugin supports following platforms: vmware. You selected ec2 platform which is not supported by this plugin, sorry.')
|
|
139
|
+
@plugin.run
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
it "should not fail if previous plugin is not a platform plugin" do
|
|
143
|
+
@plugin.instance_variable_set(:@previous_plugin_info, {:type => :os, :name => :fedora})
|
|
144
|
+
@plugin.register_supported_platform('vmware')
|
|
145
|
+
@log.should_not_receive(:error)
|
|
146
|
+
@plugin.run
|
|
147
|
+
end
|
|
134
148
|
end
|
|
135
149
|
|
|
136
150
|
it "should register a supported os" do
|
|
@@ -85,7 +85,7 @@ module BoxGrinder
|
|
|
85
85
|
supported_oses.size.should == 3
|
|
86
86
|
Set.new(supported_oses.keys).should == Set.new(['fedora', 'rhel', 'centos'])
|
|
87
87
|
supported_oses['rhel'].should == ['6']
|
|
88
|
-
supported_oses['fedora'].should == ['13', '14', '15']
|
|
88
|
+
supported_oses['fedora'].should == ['13', '14', '15', '16']
|
|
89
89
|
supported_oses['centos'].should == ['5']
|
|
90
90
|
end
|
|
91
91
|
|
|
@@ -92,20 +92,11 @@ module BoxGrinder
|
|
|
92
92
|
context "BGBUILD-204" do
|
|
93
93
|
it "should disable bios device name hints for GRUB legacy" do
|
|
94
94
|
guestfs = mock("GuestFS")
|
|
95
|
-
guestfs.should_receive(:exists).with("/boot/grub2/grub.cfg").and_return(0)
|
|
96
95
|
guestfs.should_receive(:exists).with("/boot/grub/grub.conf").and_return(1)
|
|
97
96
|
guestfs.should_receive(:sh).with("sed -i \"s/kernel\\(.*\\)/kernel\\1 biosdevname=0/g\" /boot/grub/grub.conf")
|
|
98
97
|
@plugin.disable_biosdevname(guestfs)
|
|
99
98
|
end
|
|
100
99
|
|
|
101
|
-
it "should disable bios device name hints for GRUB2" do
|
|
102
|
-
guestfs = mock("GuestFS")
|
|
103
|
-
guestfs.should_receive(:exists).with("/boot/grub2/grub.cfg").and_return(1)
|
|
104
|
-
guestfs.should_receive(:exists).with("/boot/grub/grub.conf").and_return(0)
|
|
105
|
-
guestfs.should_receive(:write).with("/etc/default/grub", "GRUB_CMDLINE_LINUX=\"quiet rhgb biosdevname=0\"\n")
|
|
106
|
-
@plugin.disable_biosdevname(guestfs)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
100
|
it "should change to runlevel 3 by default" do
|
|
110
101
|
guestfs = mock("GuestFS")
|
|
111
102
|
guestfs.should_receive(:rm).with("/etc/systemd/system/default.target")
|
|
@@ -130,9 +121,12 @@ module BoxGrinder
|
|
|
130
121
|
guestfs = mock("GuestFS")
|
|
131
122
|
guestfs_helper = mock("GuestFSHelper")
|
|
132
123
|
guestfs_helper.should_receive(:sh).ordered.with("yum -y remove grub")
|
|
124
|
+
guestfs_helper.should_receive(:sh).ordered.with("yum -y install grub2")
|
|
133
125
|
guestfs.should_receive(:list_devices).and_return(['/dev/vda'])
|
|
134
126
|
guestfs.should_receive(:sh).ordered.with("cd / && grub2-install --force /dev/vda")
|
|
135
127
|
guestfs.should_receive(:sh).ordered.with("cd / && grub2-mkconfig -o /boot/grub2/grub.cfg")
|
|
128
|
+
guestfs.should_receive(:exists).with("/boot/grub2/grub.cfg").and_return(1)
|
|
129
|
+
guestfs.should_receive(:write).with("/etc/default/grub", "GRUB_CMDLINE_LINUX=\"quiet rhgb biosdevname=0\"\n")
|
|
136
130
|
@plugin.switch_to_grub2(guestfs, guestfs_helper)
|
|
137
131
|
end
|
|
138
132
|
describe ".execute" do
|
|
@@ -353,7 +353,11 @@ module BoxGrinder
|
|
|
353
353
|
guestfs.should_receive(:exists).with("/opt").once.and_return(1)
|
|
354
354
|
guestfs.should_receive(:tar_in).with("/tmp/bg_install_files.tar", "/opt")
|
|
355
355
|
|
|
356
|
-
|
|
356
|
+
File.stub!(:exists?)
|
|
357
|
+
File.should_receive(:exists?).with('./abc').and_return(true)
|
|
358
|
+
File.should_receive(:exists?).with('./def').and_return(true)
|
|
359
|
+
|
|
360
|
+
@exec_helper.should_receive(:execute).with("cd . && tar -cvf /tmp/bg_install_files.tar --wildcards abc def")
|
|
357
361
|
|
|
358
362
|
@plugin.install_files(guestfs)
|
|
359
363
|
end
|
|
@@ -366,7 +370,11 @@ module BoxGrinder
|
|
|
366
370
|
guestfs.should_receive(:exists).with("/opt").once.and_return(1)
|
|
367
371
|
guestfs.should_receive(:tar_in).with("/tmp/bg_install_files.tar", "/opt")
|
|
368
372
|
|
|
369
|
-
|
|
373
|
+
File.stub!(:exists?)
|
|
374
|
+
File.should_receive(:exists?).with('/opt/abc').and_return(true)
|
|
375
|
+
File.should_receive(:exists?).with('/opt/def').and_return(true)
|
|
376
|
+
|
|
377
|
+
@exec_helper.should_receive(:execute).with("cd . && tar -cvf /tmp/bg_install_files.tar --wildcards /opt/abc /opt/def")
|
|
370
378
|
|
|
371
379
|
@plugin.install_files(guestfs)
|
|
372
380
|
end
|
|
@@ -394,10 +402,45 @@ module BoxGrinder
|
|
|
394
402
|
guestfs.should_receive(:mkdir_p).with("/opt/aaa")
|
|
395
403
|
guestfs.should_receive(:tar_in).with("/tmp/bg_install_files.tar", "/opt/aaa")
|
|
396
404
|
|
|
397
|
-
|
|
405
|
+
File.stub!(:exists?)
|
|
406
|
+
File.should_receive(:exists?).with('./abc').and_return(true)
|
|
407
|
+
|
|
408
|
+
@exec_helper.should_receive(:execute).with("cd . && tar -cvf /tmp/bg_install_files.tar --wildcards abc")
|
|
409
|
+
|
|
410
|
+
@plugin.install_files(guestfs)
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
it "should upload files when correctly when appliance definition file is not in current directory" do
|
|
414
|
+
@appliance_config.stub!(:files).and_return("/opt/aaa" => ['abc', '/blah/def'])
|
|
415
|
+
@plugin.instance_variable_set(:@appliance_definition_file, "some/dir/to/file.appl")
|
|
416
|
+
|
|
417
|
+
guestfs = mock("GuestFS")
|
|
418
|
+
guestfs.should_receive(:exists).with("/opt/aaa").and_return(0)
|
|
419
|
+
guestfs.should_receive(:mkdir_p).with("/opt/aaa")
|
|
420
|
+
guestfs.should_receive(:tar_in).with("/tmp/bg_install_files.tar", "/opt/aaa")
|
|
421
|
+
|
|
422
|
+
File.stub!(:exists?)
|
|
423
|
+
File.should_receive(:exists?).with('some/dir/to/abc').and_return(true)
|
|
424
|
+
File.should_receive(:exists?).with('/blah/def').and_return(true)
|
|
425
|
+
|
|
426
|
+
@exec_helper.should_receive(:execute).with("cd some/dir/to && tar -cvf /tmp/bg_install_files.tar --wildcards abc /blah/def")
|
|
398
427
|
|
|
399
428
|
@plugin.install_files(guestfs)
|
|
400
429
|
end
|
|
430
|
+
|
|
431
|
+
it "should raise if file doesn't exists" do
|
|
432
|
+
@appliance_config.stub!(:files).and_return("/opt/aaa" => ['abc', '/blah/def'])
|
|
433
|
+
@plugin.instance_variable_set(:@appliance_definition_file, "some/dir/to/file.appl")
|
|
434
|
+
|
|
435
|
+
guestfs = mock("GuestFS")
|
|
436
|
+
guestfs.should_receive(:exists).with("/opt/aaa").and_return(0)
|
|
437
|
+
guestfs.should_receive(:mkdir_p).with("/opt/aaa")
|
|
438
|
+
|
|
439
|
+
File.stub!(:exists?)
|
|
440
|
+
File.should_receive(:exists?).with('some/dir/to/abc').and_return(false)
|
|
441
|
+
|
|
442
|
+
lambda { @plugin.install_files(guestfs) }.should raise_error(ValidationError, "File 'abc' specified in files section of appliance definition file doesn't exists.")
|
|
443
|
+
end
|
|
401
444
|
end
|
|
402
445
|
|
|
403
446
|
describe ".set_label_for_swap_partitions" do
|
|
@@ -109,15 +109,17 @@ module BoxGrinder
|
|
|
109
109
|
Tempfile.should_receive(:new).with("rc_local").and_return(tempfile)
|
|
110
110
|
File.should_receive(:read).with(any_args()).and_return("with other content")
|
|
111
111
|
|
|
112
|
-
guestfs.should_receive(:
|
|
113
|
-
|
|
112
|
+
guestfs.should_receive(:exists).with('/etc/rc.d/rc.local').and_return(1)
|
|
113
|
+
guestfs.should_receive(:read_file).once.ordered.with("/etc/rc.d/rc.local").and_return("content ")
|
|
114
|
+
tempfile.should_receive(:<<).once.ordered.with("content ")
|
|
115
|
+
tempfile.should_receive(:<<).once.ordered.with("with other content")
|
|
114
116
|
tempfile.should_receive(:flush).once.ordered
|
|
115
117
|
tempfile.should_receive(:path).once.ordered.and_return("path")
|
|
116
|
-
guestfs.should_receive(:upload).once.ordered.with("path", "/etc/rc.local")
|
|
118
|
+
guestfs.should_receive(:upload).once.ordered.with("path", "/etc/rc.d/rc.local")
|
|
117
119
|
tempfile.should_receive(:close).once.ordered
|
|
118
120
|
|
|
119
|
-
@log.should_receive(:debug).once.with("Uploading '/etc/rc.local' file...")
|
|
120
|
-
@log.should_receive(:debug).once.with("'/etc/rc.local' file uploaded.")
|
|
121
|
+
@log.should_receive(:debug).once.with("Uploading '/etc/rc.d/rc.local' file...")
|
|
122
|
+
@log.should_receive(:debug).once.with("'/etc/rc.d/rc.local' file uploaded.")
|
|
121
123
|
|
|
122
124
|
@plugin.upload_rc_local(guestfs)
|
|
123
125
|
end
|
|
@@ -131,18 +133,23 @@ module BoxGrinder
|
|
|
131
133
|
Tempfile.should_receive(:new).with("rc_local").and_return(tempfile)
|
|
132
134
|
File.should_receive(:read).with(any_args()).and_return("with other content")
|
|
133
135
|
|
|
134
|
-
guestfs.should_receive(:
|
|
135
|
-
|
|
136
|
+
guestfs.should_receive(:exists).with('/etc/rc.d/rc.local').and_return(0)
|
|
137
|
+
guestfs.should_not_receive(:read_file).with("/etc/rc.d/rc.local")
|
|
138
|
+
tempfile.should_receive(:<<).once.ordered.with("#!/bin/bash\n\n")
|
|
139
|
+
tempfile.should_receive(:<<).once.ordered.with("with other content")
|
|
136
140
|
tempfile.should_receive(:flush).once.ordered
|
|
137
141
|
tempfile.should_receive(:path).once.ordered.and_return("path")
|
|
138
|
-
guestfs.should_receive(:upload).once.ordered.with("path", "/etc/rc.local")
|
|
142
|
+
guestfs.should_receive(:upload).once.ordered.with("path", "/etc/rc.d/rc.local")
|
|
139
143
|
tempfile.should_receive(:close).once.ordered
|
|
140
144
|
|
|
141
|
-
@log.should_receive(:debug).once.with("Uploading '/etc/rc.local' file...")
|
|
142
|
-
@log.should_receive(:debug).once.with("'/etc/rc.local' file uploaded.")
|
|
145
|
+
@log.should_receive(:debug).once.with("Uploading '/etc/rc.d/rc.local' file...")
|
|
146
|
+
@log.should_receive(:debug).once.with("'/etc/rc.d/rc.local' file uploaded.")
|
|
143
147
|
|
|
144
148
|
guestfs.should_receive(:cp).with("/lib/systemd/system/rc-local.service", "/etc/systemd/system/")
|
|
145
149
|
guestfs.should_receive(:sh).with("sed -i '/^ConditionFileIsExecutable/a After=network.target' /etc/systemd/system/rc-local.service")
|
|
150
|
+
guestfs.should_receive(:sh).with("systemctl enable rc-local.service")
|
|
151
|
+
guestfs.should_receive(:ln_sf).with("/etc/rc.d/rc.local", "/etc/rc.local")
|
|
152
|
+
guestfs.should_receive(:chmod).with(0755, "/etc/rc.d/rc.local")
|
|
146
153
|
|
|
147
154
|
@plugin.upload_rc_local(guestfs)
|
|
148
155
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: boxgrinder-build
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 53
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 9
|
|
9
|
-
-
|
|
10
|
-
version: 0.9.
|
|
9
|
+
- 7
|
|
10
|
+
version: 0.9.7
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Marek Goldmann
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-09-
|
|
18
|
+
date: 2011-09-10 00:00:00 +02:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
@@ -168,25 +168,28 @@ files:
|
|
|
168
168
|
- Rakefile
|
|
169
169
|
- bin/boxgrinder-build
|
|
170
170
|
- boxgrinder-build.gemspec
|
|
171
|
-
- integ/appliances/_hardware_cpus.appl
|
|
172
|
-
- integ/appliances/_hardware_memory.appl
|
|
173
|
-
- integ/appliances/_hardware_partitions_home.appl
|
|
174
|
-
- integ/appliances/_hardware_partitions_root.appl
|
|
175
|
-
- integ/appliances/_os_password.appl
|
|
176
|
-
- integ/appliances/_packages_groups_base.appl
|
|
177
|
-
- integ/appliances/_packages_groups_core.appl
|
|
178
|
-
- integ/appliances/_packages_squid.appl
|
|
179
|
-
- integ/appliances/_packages_utils.appl
|
|
180
|
-
- integ/appliances/_repos_boxgrinder_permanent_noarch.appl
|
|
181
|
-
- integ/appliances/_repos_testlocal_ephemeral_noarch.appl
|
|
182
|
-
- integ/appliances/_test_base.appl
|
|
183
171
|
- integ/appliances/gnome-fedora.appl
|
|
184
|
-
- integ/appliances/jeos-
|
|
172
|
+
- integ/appliances/jeos-centos5-files.appl
|
|
173
|
+
- integ/appliances/jeos-centos5.appl
|
|
174
|
+
- integ/appliances/jeos-f15.appl
|
|
175
|
+
- integ/appliances/jeos-f16-files.appl
|
|
185
176
|
- integ/appliances/jeos-f16.appl
|
|
186
|
-
- integ/appliances/
|
|
187
|
-
- integ/appliances/modular.appl
|
|
177
|
+
- integ/appliances/modular/_hardware_cpus.appl
|
|
178
|
+
- integ/appliances/modular/_hardware_memory.appl
|
|
179
|
+
- integ/appliances/modular/_hardware_partitions_home.appl
|
|
180
|
+
- integ/appliances/modular/_hardware_partitions_root.appl
|
|
181
|
+
- integ/appliances/modular/_os_password.appl
|
|
182
|
+
- integ/appliances/modular/_packages_groups_base.appl
|
|
183
|
+
- integ/appliances/modular/_packages_groups_core.appl
|
|
184
|
+
- integ/appliances/modular/_packages_squid.appl
|
|
185
|
+
- integ/appliances/modular/_packages_utils.appl
|
|
186
|
+
- integ/appliances/modular/_repos_boxgrinder_permanent_noarch.appl
|
|
187
|
+
- integ/appliances/modular/_repos_testlocal_ephemeral_noarch.appl
|
|
188
|
+
- integ/appliances/modular/_test_base.appl
|
|
189
|
+
- integ/appliances/modular/modular.appl
|
|
188
190
|
- integ/packages/ephemeral-repo-test-0.1-1.noarch.rpm
|
|
189
191
|
- integ/packages/local-repo-test.spec
|
|
192
|
+
- integ/spec/files-spec.rb
|
|
190
193
|
- integ/spec/jeos-spec.rb
|
|
191
194
|
- integ/spec/modular-spec.rb
|
|
192
195
|
- lib/boxgrinder-build.rb
|