boxgrinder-build 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Copyright 2010 Red Hat, Inc.
4
- #
5
- # This is free software; you can redistribute it and/or modify it
6
- # under the terms of the GNU Lesser General Public License as
7
- # published by the Free Software Foundation; either version 3 of
8
- # the License, or (at your option) any later version.
9
- #
10
- # This software is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- # Lesser General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU Lesser General Public
16
- # License along with this software; if not, write to the Free
17
- # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
-
20
- require 'rubygems'
21
- require 'boxgrinder-core/helpers/log-helper'
22
- require 'boxgrinder-build/appliance'
23
-
24
- #$stderr.reopen($stdout)
25
-
26
- if Process.uid != 0
27
- puts "This program must be executed with root privileges. Try 'sudo boxgrinder-build'"
28
- abort
29
- end
30
-
31
- require 'commander/import'
32
-
33
- module Commander
34
- class Runner
35
- def run!
36
- require_program :version, :description
37
- trap('INT') { abort program(:int_message) } if program(:int_message)
38
- trap('INT') { program(:int_block).call } if program(:int_block)
39
- global_option('-h', '--help', 'Display help documentation') { command(:help).run *@args[1..-1]; return }
40
- global_option('-v', '--version', 'Display version information') { say version; return }
41
- parse_global_options
42
- remove_global_options options, @args
43
- run_active_command
44
- end
45
- end
46
- end
47
-
48
- program :name, 'BoxGrinder Build'
49
- program :version, '0.7.1'
50
- program :description, "A tool for building VM images from simple definition files."
51
- program :help, 'Homepage', 'http://www.jboss.org/boxgrinder/build.html'
52
- program :help, 'Documentation', 'http://community.jboss.org/docs/DOC-14358'
53
- program :help, 'Examples', "Run 'boxgrinder-build -h build' for more info about syntax."
54
- default_command :build
55
-
56
- $log_level = :info
57
-
58
- global_option('-V', '--verbose', TrueClass, "Prints debug information while building. Default: false.") { $log_level = :debug }
59
- global_option('-W', '--very-verbose', TrueClass, "Prints trace information while building. Default: false.") { $log_level = :trace }
60
-
61
- module BoxGrinder
62
- command :build do |c|
63
- c.syntax = 'build appliance_definition.appl [options]'
64
- c.description = 'Creates an image from selected appliance definition for selected platform.'
65
- c.examples = "boxgrinder-build test.appl -p vmware\nboxgrinder-build test.appl -p ec2 -d ami\nboxgrinder-build test.appl -d sftp"
66
-
67
- force = false
68
-
69
- c.option '-p STRING', '--platform STRING', String, "The type of platform. Default: none." # Valid types are: #{PlatformPluginManager.instance.plugins.keys.join(', ')}. Default: none."
70
- c.option '-d STRING', '--delivery STRING', String, "The delivery type for selected image. Default: none." # Valid types are: #{DeliveryPluginManager.instance.types.keys.join(', ')}. Default: none."
71
- c.option('-f', '--force', "Force image creation - removes all previous builds for selected appliance.") { force = true }
72
- c.option '-l STRING', '--plugins STRING', String, "Comma separated list of plugins. Default: default plugins will be available."
73
-
74
- c.action do |args, options|
75
- options.default :platform => :none
76
- options.default :delivery => :none
77
-
78
- options.force = force
79
- options.name = program(:name)
80
- options.version = program(:version)
81
- options.platform = options.platform.to_s.downcase.to_sym
82
- options.delivery = options.delivery.to_s.downcase.to_sym
83
-
84
- appliance_definition_file = args.shift or raise("You need to specify appliance definition file. Run 'boxgrinder-build -h' for more info")
85
-
86
- raise "Appliance definition file '#{appliance_definition_file}' could not be found" unless File.exists?(appliance_definition_file)
87
-
88
- Appliance.new(appliance_definition_file, :options => options, :log => LogHelper.new(:threshold => $log_level)).create
89
- end
90
- end
91
- end
@@ -1,27 +0,0 @@
1
- name: jeos-f13
2
- summary: Just Enough Operating System based on Fedora 13
3
- os:
4
- name: fedora
5
- version: 13
6
- hardware:
7
- partitions:
8
- "/":
9
- size: 2
10
- packages:
11
- includes:
12
- - bash
13
- - kernel-PAE
14
- - grub
15
- - e2fsprogs
16
- - passwd
17
- - policycoreutils
18
- - chkconfig
19
- - rootfiles
20
- - yum
21
- - vim-minimal
22
- - acpid
23
- - dhclient
24
- - iputils
25
- - openssh-server
26
- - openssh-clients
27
- - system-config-firewall-base
@@ -1,23 +0,0 @@
1
- # bg_os_name: fedora
2
- # bg_os_version: 13
3
-
4
- lang en_US.UTF-8
5
- keyboard us
6
- timezone US/Eastern
7
- auth --useshadow --enablemd5
8
- selinux --permissive
9
- firewall --disabled
10
- bootloader --timeout=1 --append="acpi=force scsi_mod.scan=sync"
11
- firstboot --disabled
12
- network --bootproto=dhcp --device=eth0 --onboot=on
13
- services --enabled=network
14
- rootpw boxgrinder
15
-
16
- part / --size 2048 --fstype ext4 --ondisk sda
17
-
18
- repo --name=fedora-14-base --cost=40 --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-13&arch=x86_64
19
- repo --name=fedora-14-updates --cost=41 --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f13&arch=x86_64
20
-
21
- %packages --excludedocs --nobase
22
- @core
23
- %end