boxgrinder-build 0.2.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/bin/boxgrinder-build +81 -0
  2. data/docs/examples/appliances/appliances.appl +5 -0
  3. data/docs/examples/appliances/minimal.appl +9 -0
  4. data/docs/examples/appliances/mix.appl +8 -0
  5. data/docs/examples/appliances/packages.appl +13 -0
  6. data/lib/boxgrinder-build/appliance.rb +85 -18
  7. data/lib/boxgrinder-build/helpers/appliance-customize-helper.rb +2 -2
  8. data/lib/boxgrinder-build/helpers/guestfs-helper.rb +18 -15
  9. data/lib/boxgrinder-build/helpers/package-helper.rb +65 -0
  10. data/lib/boxgrinder-build/helpers/plugin-helper.rb +89 -0
  11. data/lib/boxgrinder-build/{defaults.rb → managers/base-plugin-manager.rb} +41 -8
  12. data/lib/{boxgrinder-build.rb → boxgrinder-build/managers/delivery-plugin-manager.rb} +15 -18
  13. data/lib/boxgrinder-build/managers/operating-system-plugin-manager.rb +6 -0
  14. data/{bin/boxgrinder → lib/boxgrinder-build/managers/platform-plugin-manager.rb} +6 -3
  15. data/lib/boxgrinder-build/plugins/base-plugin.rb +98 -0
  16. data/lib/boxgrinder-build/plugins/delivery/base/base-delivery-plugin.rb +43 -0
  17. data/lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb +57 -0
  18. data/lib/boxgrinder-build/{helpers → plugins/delivery/s3}/aws-helper.rb +0 -0
  19. data/lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb +133 -0
  20. data/lib/boxgrinder-build/{helpers/ssh-helper.rb → plugins/delivery/sftp/sftp-plugin.rb} +61 -42
  21. data/lib/boxgrinder-build/{appliance-kickstart.rb → plugins/os/base/kickstart.rb} +45 -55
  22. data/lib/boxgrinder-build/{images/raw-image.rb → plugins/os/base/rpm-based-os-plugin.rb} +63 -60
  23. data/lib/boxgrinder-build/{erb → plugins/os/base/src}/appliance.ks.erb +2 -5
  24. data/{src → lib/boxgrinder-build/plugins/os/base/src}/base.repo +0 -0
  25. data/{src → lib/boxgrinder-build/plugins/os/base/src}/motd.init +0 -0
  26. data/lib/boxgrinder-build/{validators/appliance-dependency-validator.rb → plugins/os/base/validators/rpm-dependency-validator.rb} +1 -1
  27. data/lib/boxgrinder-build/{models/ssh-config.rb → plugins/os/base-operating-system-plugin.rb} +10 -17
  28. data/lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb +72 -0
  29. data/lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb +66 -0
  30. data/lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb +38 -0
  31. data/lib/boxgrinder-build/plugins/platform/base-platform-plugin.rb +37 -0
  32. data/lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb +283 -0
  33. data/{src → lib/boxgrinder-build/plugins/platform/ec2/src}/f12/yum.conf +0 -0
  34. data/{src/ec2 → lib/boxgrinder-build/plugins/platform/ec2/src}/f12-i386-boxgrinder.repo +0 -0
  35. data/{src/ec2 → lib/boxgrinder-build/plugins/platform/ec2/src}/f12-x86_64-boxgrinder.repo +0 -0
  36. data/{src/ec2 → lib/boxgrinder-build/plugins/platform/ec2/src}/fstab_32bit +0 -0
  37. data/{src/ec2 → lib/boxgrinder-build/plugins/platform/ec2/src}/fstab_64bit +0 -0
  38. data/{src/ec2 → lib/boxgrinder-build/plugins/platform/ec2/src}/ifcfg-eth0 +0 -0
  39. data/{src/ec2 → lib/boxgrinder-build/plugins/platform/ec2/src}/rc_local +1 -4
  40. data/{src/README.vmware → lib/boxgrinder-build/plugins/platform/vmware/src/README} +10 -10
  41. data/{src → lib/boxgrinder-build/plugins/platform/vmware/src}/base.vmdk +1 -1
  42. data/{src → lib/boxgrinder-build/plugins/platform/vmware/src}/base.vmx +0 -0
  43. data/lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb +181 -0
  44. data/lib/boxgrinder-build/validators/config-validator.rb +0 -19
  45. metadata +73 -44
  46. data/docs/examples/appliances/appliances-appliance/appliances-appliance.appl +0 -6
  47. data/docs/examples/appliances/appliances-appliance/appliances-appliance.pp +0 -16
  48. data/docs/examples/appliances/minimal-appliance/minimal-appliance.appl +0 -2
  49. data/docs/examples/appliances/minimal-appliance/minimal-appliance.pp +0 -16
  50. data/docs/examples/appliances/mix-appliance/mix-appliance.appl +0 -9
  51. data/docs/examples/appliances/mix-appliance/mix-appliance.pp +0 -16
  52. data/docs/examples/appliances/packages-appliance/packages-appliance.appl +0 -6
  53. data/docs/examples/appliances/packages-appliance/packages-appliance.pp +0 -16
  54. data/extras/sign-rpms +0 -12
  55. data/lib/boxgrinder-build/boxgrinder.rb +0 -93
  56. data/lib/boxgrinder-build/helpers/release-helper.rb +0 -136
  57. data/lib/boxgrinder-build/images/ec2-image.rb +0 -317
  58. data/lib/boxgrinder-build/images/vmware-image.rb +0 -214
  59. data/lib/boxgrinder-build/validators/appliance-definition-validator.rb +0 -89
  60. data/lib/progressbar/progressbar.rb +0 -236
  61. data/src/oddthesis/RPM-GPG-KEY-oddthesis +0 -30
  62. data/src/oddthesis/oddthesis.repo +0 -23
@@ -1,236 +0,0 @@
1
- #
2
- # Ruby/ProgressBar - a text progress bar library
3
- #
4
- # Copyright (C) 2001-2005 Satoru Takabayashi <satoru@namazu.org>
5
- # All rights reserved.
6
- # This is free software with ABSOLUTELY NO WARRANTY.
7
- #
8
- # You can redistribute it and/or modify it under the terms
9
- # of Ruby's license.
10
- #
11
-
12
- class ProgressBar
13
- VERSION = "0.9"
14
-
15
- def initialize (title, total, out = STDERR)
16
- @title = title
17
- @total = total
18
- @out = out
19
- @terminal_width = 80
20
- @bar_mark = "o"
21
- @current = 0
22
- @previous = 0
23
- @finished_p = false
24
- @start_time = Time.now
25
- @previous_time = @start_time
26
- @title_width = 14
27
- @format = "%-#{@title_width}s %3d%% %s %s"
28
- @format_arguments = [:title, :percentage, :bar, :stat]
29
- clear
30
- show
31
- end
32
- attr_reader :title
33
- attr_reader :current
34
- attr_reader :total
35
- attr_accessor :start_time
36
-
37
- private
38
- def fmt_bar
39
- bar_width = do_percentage * @terminal_width / 100
40
- sprintf("|%s%s|",
41
- @bar_mark * bar_width,
42
- " " * (@terminal_width - bar_width))
43
- end
44
-
45
- def fmt_percentage
46
- do_percentage
47
- end
48
-
49
- def fmt_stat
50
- if @finished_p then elapsed else eta end
51
- end
52
-
53
- def fmt_stat_for_file_transfer
54
- if @finished_p then
55
- sprintf("%s %s %s", bytes, transfer_rate, elapsed)
56
- else
57
- sprintf("%s %s %s", bytes, transfer_rate, eta)
58
- end
59
- end
60
-
61
- def fmt_title
62
- @title[0,(@title_width - 1)] + ":"
63
- end
64
-
65
- def convert_bytes (bytes)
66
- if bytes < 1024
67
- sprintf("%6dB", bytes)
68
- elsif bytes < 1024 * 1000 # 1000kb
69
- sprintf("%5.1fKB", bytes.to_f / 1024)
70
- elsif bytes < 1024 * 1024 * 1000 # 1000mb
71
- sprintf("%5.1fMB", bytes.to_f / 1024 / 1024)
72
- else
73
- sprintf("%5.1fGB", bytes.to_f / 1024 / 1024 / 1024)
74
- end
75
- end
76
-
77
- def transfer_rate
78
- bytes_per_second = @current.to_f / (Time.now - @start_time)
79
- sprintf("%s/s", convert_bytes(bytes_per_second))
80
- end
81
-
82
- def bytes
83
- convert_bytes(@current)
84
- end
85
-
86
- def format_time (t)
87
- t = t.to_i
88
- sec = t % 60
89
- min = (t / 60) % 60
90
- hour = t / 3600
91
- sprintf("%02d:%02d:%02d", hour, min, sec);
92
- end
93
-
94
- # ETA stands for Estimated Time of Arrival.
95
- def eta
96
- if @current == 0
97
- "ETA: --:--:--"
98
- else
99
- elapsed = Time.now - @start_time
100
- eta = elapsed * @total / @current - elapsed;
101
- sprintf("ETA: %s", format_time(eta))
102
- end
103
- end
104
-
105
- def elapsed
106
- elapsed = Time.now - @start_time
107
- sprintf("Time: %s", format_time(elapsed))
108
- end
109
-
110
- def eol
111
- if @finished_p then "\n" else "\r" end
112
- end
113
-
114
- def do_percentage
115
- if @total.zero?
116
- 100
117
- else
118
- @current * 100 / @total
119
- end
120
- end
121
-
122
- def get_width
123
- # FIXME: I don't know how portable it is.
124
- default_width = 80
125
- begin
126
- tiocgwinsz = 0x5413
127
- data = [0, 0, 0, 0].pack("SSSS")
128
- if @out.ioctl(tiocgwinsz, data) >= 0 then
129
- rows, cols, xpixels, ypixels = data.unpack("SSSS")
130
- if cols >= 0 then cols else default_width end
131
- else
132
- default_width
133
- end
134
- rescue Exception
135
- default_width
136
- end
137
- end
138
-
139
- def show
140
- arguments = @format_arguments.map {|method|
141
- method = sprintf("fmt_%s", method)
142
- send(method)
143
- }
144
- line = sprintf(@format, *arguments)
145
-
146
- width = get_width
147
- if line.length == width - 1
148
- @out.print(line + eol)
149
- @out.flush
150
- elsif line.length >= width
151
- @terminal_width = [@terminal_width - (line.length - width + 1), 0].max
152
- if @terminal_width == 0 then @out.print(line + eol) else show end
153
- else # line.length < width - 1
154
- @terminal_width += width - line.length + 1
155
- show
156
- end
157
- @previous_time = Time.now
158
- end
159
-
160
- def show_if_needed
161
- if @total.zero?
162
- cur_percentage = 100
163
- prev_percentage = 0
164
- else
165
- cur_percentage = (@current * 100 / @total).to_i
166
- prev_percentage = (@previous * 100 / @total).to_i
167
- end
168
-
169
- # Use "!=" instead of ">" to support negative changes
170
- if cur_percentage != prev_percentage ||
171
- Time.now - @previous_time >= 1 || @finished_p
172
- show
173
- end
174
- end
175
-
176
- public
177
- def clear
178
- @out.print "\r"
179
- @out.print(" " * (get_width - 1))
180
- @out.print "\r"
181
- end
182
-
183
- def finish
184
- @current = @total
185
- @finished_p = true
186
- show
187
- end
188
-
189
- def finished?
190
- @finished_p
191
- end
192
-
193
- def file_transfer_mode
194
- @format_arguments = [:title, :percentage, :bar, :stat_for_file_transfer]
195
- end
196
-
197
- def format= (format)
198
- @format = format
199
- end
200
-
201
- def format_arguments= (arguments)
202
- @format_arguments = arguments
203
- end
204
-
205
- def halt
206
- @finished_p = true
207
- show
208
- end
209
-
210
- def inc (step = 1)
211
- @current += step
212
- @current = @total if @current > @total
213
- show_if_needed
214
- @previous = @current
215
- end
216
-
217
- def set (count)
218
- if count < 0 || count > @total
219
- raise "invalid count: #{count} (total: #{@total})"
220
- end
221
- @current = count
222
- show_if_needed
223
- @previous = @current
224
- end
225
-
226
- def inspect
227
- "#<ProgressBar:#{@current}/#{@total}>"
228
- end
229
- end
230
-
231
- class ReversedProgressBar < ProgressBar
232
- def do_percentage
233
- 100 - super
234
- end
235
- end
236
-
@@ -1,30 +0,0 @@
1
- -----BEGIN PGP PUBLIC KEY BLOCK-----
2
- Version: GnuPG v1.4.9 (GNU/Linux)
3
-
4
- mQGiBElvb1cRBADrcvfRckstSodFlMkJtf0BMQm8XJj/F75uolRo8lyZ9SSrjhzt
5
- fapRKsyu+UGvK6O0v8ctb9A9lB9qMuEDtzIzlGDtYxaTHsFSPjHVszN4FQb1lS9I
6
- V1AnqDAjO3Rdxe5pzXawEDCzdY1OyTAALDNmaQOMB2L/9A9V0bJuX+ilfwCghT9M
7
- ZFSFjJtTiZh/scywM31aH7MD/A8ak+RRZDprAZzobS6UdKbpdLBX1y1GD4LXBlNE
8
- ydztVbvL2WN86X7SWx6ABQswjnBX1mAPRWBMMh7KIywsY4crDxo6DJtxmtrC7z2J
9
- DZzkIpQfQIJ3Efpdxw7oo4k7kOZ7+o1raUAP+Afuq96dA2y8k5C+ZoGoCWwdtHGV
10
- 0erbA/47vMsfk52nMT/WJhzICbdgdLbaq2tfECixnQ87tgMaceSW9aObCBBAxOWW
11
- 0h8ouragmbPCMXRRYP/CuX/Vlwdp2e8k/O6nt1iIEgcjigVF13aSJMkSFK0HwZQb
12
- FN0DvIOrkGLtGWQhwMOZRGNqgvqV1wtmLt1yZm4VejkvKdE3iLRDT2RkdGhlc2lz
13
- IChPZGR0aGVzaXMgcmVwb3NpdG9yeSBzaWduaW5nIGtleSkgPHNpZ25lckBvZGR0
14
- aGVzaXMub3JnPohgBBMRAgAgBQJJb29XAhsDBgsJCAcDAgQVAggDBBYCAwECHgEC
15
- F4AACgkQIp90s0whxNUjQgCeORRKIO/90Lik+YocOdFdS9wFolEAn3FWeI96i5hR
16
- deFhbDTAtGZiFY/ZuQINBElvb1cQCACNsy9/8+ijcWmjjzgwGeNdMYOGt9rLDgzY
17
- cd8lQl0ZmVRXFUyJDObP3EfSWsGWAfQVj/rLaPbw70+2anw8p/C8m6r3diR70Bxf
18
- YUqOJV7BMk1xrf+C0gka3MmegRWF1GBNxNgNGkgPcVsnnPLqIktYuXw7pFpk7Jkc
19
- eNn7p+Ug5mja/Is2SCc8jP6ehAFdF6+Az747mF29QbQHAkfORavYNJP6Xcya6uZJ
20
- qCS76iJeBkoaZWz5DW35wCYGqR2qcv+RoTEGrXyPi9dw4zg3tWkhIIZ6gRp9kOEC
21
- xAwVJ+uGsYJZk3K6UhyCRscqLuZQfFzMHUBpeItLeFZoxHH4hpDzAAMGB/9/Gi9B
22
- VWfynPUHcdh6xg2xSYG4vfeZ/891vyfOa4kRjmktgitRiIjYzQnBX76Jsxo2dIPi
23
- 2jPc2vxvsi7EaS3bido7abpp8u6qYq87XrLD2gkyM5uOjz8dtfwX1RZsfifdZnZJ
24
- 7xcg1FUS1uYmV5MIbpwvTyJ2Sar0SRCzHCpgOfx6FLm0gwsE4+JAe4Y9dqA+neka
25
- 2XD66tk/Bxx6LnyktlWwU4ipSAwHncNQ91LAeYtPQSfIsA/x1dmBwe+mOIvqc//i
26
- N9WaXSJGV3kMv9ocyi0bZ3N0ZycvmY53CVmH/E6L4BfccYPu/+6E4fqi2Rdkh/F7
27
- f9L4Ft8ta2BuCa9oiEkEGBECAAkFAklvb1cCGwwACgkQIp90s0whxNWdPgCdEBC/
28
- xjCOdNp/uF8fjAGWhD/Jy9QAnRpZ3CfqJxMn6N8F5xIhK2KKw+02
29
- =rRwA
30
- -----END PGP PUBLIC KEY BLOCK-----
@@ -1,23 +0,0 @@
1
- [oddthesis-$basearch]
2
- name=Odd Thesis $basearch
3
- failovermethod=priority
4
- baseurl=http://repo.oddthesis.org/packages/#OS_NAME#/#OS_VERSION#/RPMS/$basearch/
5
- enabled=1
6
- gpgcheck=0
7
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oddthesis
8
-
9
- [oddthesis-noarch]
10
- name=Odd Thesis noarch
11
- failovermethod=priority
12
- baseurl=http://repo.oddthesis.org/packages/#OS_NAME#/#OS_VERSION#/RPMS/noarch/
13
- enabled=1
14
- gpgcheck=0
15
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oddthesis
16
-
17
- [oddthesis-source]
18
- name=Odd Thesis Source
19
- failovermethod=priority
20
- baseurl=http://repo.oddthesis.org/packages/#OS_NAME#/#OS_VERSION#/SRPMS/
21
- enabled=0
22
- gpgcheck=1
23
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oddthesis