boxgrinder-core 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Manifest +44 -0
- data/boxgrinder-core.gemspec +4 -4
- data/lib/boxgrinder-core/helpers/appliance-config-helper.rb +18 -0
- data/lib/boxgrinder-core/helpers/appliance-definition-helper.rb +1 -0
- data/lib/boxgrinder-core/models/appliance-config.rb +2 -0
- data/lib/boxgrinder-core/schemas/appliance_schema_0.9.6.yaml +103 -0
- data/rubygem-boxgrinder-core.spec +5 -1
- metadata +6 -4
data/CHANGELOG
CHANGED
data/Manifest
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
CHANGELOG
|
2
|
+
LICENSE
|
3
|
+
Manifest
|
4
|
+
README
|
5
|
+
Rakefile
|
6
|
+
boxgrinder-core.gemspec
|
7
|
+
lib/boxgrinder-core.rb
|
8
|
+
lib/boxgrinder-core/appliance-parser.rb
|
9
|
+
lib/boxgrinder-core/appliance-validator.rb
|
10
|
+
lib/boxgrinder-core/errors.rb
|
11
|
+
lib/boxgrinder-core/helpers/appliance-config-helper.rb
|
12
|
+
lib/boxgrinder-core/helpers/appliance-definition-helper.rb
|
13
|
+
lib/boxgrinder-core/helpers/appliance-transformation-helper.rb
|
14
|
+
lib/boxgrinder-core/helpers/exec-helper.rb
|
15
|
+
lib/boxgrinder-core/helpers/log-helper.rb
|
16
|
+
lib/boxgrinder-core/models/appliance-config.rb
|
17
|
+
lib/boxgrinder-core/models/config.rb
|
18
|
+
lib/boxgrinder-core/models/task.rb
|
19
|
+
lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml
|
20
|
+
lib/boxgrinder-core/schemas/appliance_schema_0.9.0.yaml
|
21
|
+
lib/boxgrinder-core/schemas/appliance_schema_0.9.6.yaml
|
22
|
+
rubygem-boxgrinder-core.spec
|
23
|
+
spec/appliance-parser-spec.rb
|
24
|
+
spec/appliance-validator-spec.rb
|
25
|
+
spec/helpers/appliance-config-helper-spec.rb
|
26
|
+
spec/helpers/appliance-definition-helper-spec.rb
|
27
|
+
spec/helpers/appliance-transformation-helper-spec.rb
|
28
|
+
spec/helpers/exec-helper-spec.rb
|
29
|
+
spec/helpers/log-helper-spec.rb
|
30
|
+
spec/models/appliance-config-spec.rb
|
31
|
+
spec/models/config-spec.rb
|
32
|
+
spec/rspec/ls/one
|
33
|
+
spec/rspec/ls/two
|
34
|
+
spec/rspec/src/appliances/0.8.x.appl
|
35
|
+
spec/rspec/src/appliances/0.9.x-invalid.appl
|
36
|
+
spec/rspec/src/appliances/0.9.x.appl
|
37
|
+
spec/rspec/src/appliances/comments.appl
|
38
|
+
spec/rspec/src/appliances/ephemeral-repo.appl
|
39
|
+
spec/rspec/src/appliances/full.appl
|
40
|
+
spec/rspec/src/appliances/invalid-yaml.appl
|
41
|
+
spec/rspec/src/appliances/legacy.appl
|
42
|
+
spec/rspec/src/appliances/repo.appl
|
43
|
+
spec/rspec/src/config/empty
|
44
|
+
spec/rspec/src/config/valid
|
data/boxgrinder-core.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{boxgrinder-core}
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.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-
|
9
|
+
s.date = %q{2011-09-02}
|
10
10
|
s.description = %q{Core library for BoxGrinder}
|
11
11
|
s.email = %q{info@boxgrinder.org}
|
12
|
-
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "lib/boxgrinder-core.rb", "lib/boxgrinder-core/appliance-parser.rb", "lib/boxgrinder-core/appliance-validator.rb", "lib/boxgrinder-core/errors.rb", "lib/boxgrinder-core/helpers/appliance-config-helper.rb", "lib/boxgrinder-core/helpers/appliance-definition-helper.rb", "lib/boxgrinder-core/helpers/appliance-transformation-helper.rb", "lib/boxgrinder-core/helpers/exec-helper.rb", "lib/boxgrinder-core/helpers/log-helper.rb", "lib/boxgrinder-core/models/appliance-config.rb", "lib/boxgrinder-core/models/config.rb", "lib/boxgrinder-core/models/task.rb", "lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml", "lib/boxgrinder-core/schemas/appliance_schema_0.9.0.yaml"]
|
13
|
-
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "boxgrinder-core.gemspec", "lib/boxgrinder-core.rb", "lib/boxgrinder-core/appliance-parser.rb", "lib/boxgrinder-core/appliance-validator.rb", "lib/boxgrinder-core/errors.rb", "lib/boxgrinder-core/helpers/appliance-config-helper.rb", "lib/boxgrinder-core/helpers/appliance-definition-helper.rb", "lib/boxgrinder-core/helpers/appliance-transformation-helper.rb", "lib/boxgrinder-core/helpers/exec-helper.rb", "lib/boxgrinder-core/helpers/log-helper.rb", "lib/boxgrinder-core/models/appliance-config.rb", "lib/boxgrinder-core/models/config.rb", "lib/boxgrinder-core/models/task.rb", "lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml", "lib/boxgrinder-core/schemas/appliance_schema_0.9.0.yaml", "rubygem-boxgrinder-core.spec", "spec/appliance-parser-spec.rb", "spec/appliance-validator-spec.rb", "spec/helpers/appliance-config-helper-spec.rb", "spec/helpers/appliance-definition-helper-spec.rb", "spec/helpers/appliance-transformation-helper-spec.rb", "spec/helpers/exec-helper-spec.rb", "spec/helpers/log-helper-spec.rb", "spec/models/appliance-config-spec.rb", "spec/models/config-spec.rb", "spec/rspec/ls/one", "spec/rspec/ls/two", "spec/rspec/src/appliances/0.8.x.appl", "spec/rspec/src/appliances/0.9.x-invalid.appl", "spec/rspec/src/appliances/0.9.x.appl", "spec/rspec/src/appliances/comments.appl", "spec/rspec/src/appliances/ephemeral-repo.appl", "spec/rspec/src/appliances/full.appl", "spec/rspec/src/appliances/invalid-yaml.appl", "spec/rspec/src/appliances/legacy.appl", "spec/rspec/src/appliances/repo.appl", "spec/rspec/src/config/empty", "spec/rspec/src/config/valid"]
|
12
|
+
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "lib/boxgrinder-core.rb", "lib/boxgrinder-core/appliance-parser.rb", "lib/boxgrinder-core/appliance-validator.rb", "lib/boxgrinder-core/errors.rb", "lib/boxgrinder-core/helpers/appliance-config-helper.rb", "lib/boxgrinder-core/helpers/appliance-definition-helper.rb", "lib/boxgrinder-core/helpers/appliance-transformation-helper.rb", "lib/boxgrinder-core/helpers/exec-helper.rb", "lib/boxgrinder-core/helpers/log-helper.rb", "lib/boxgrinder-core/models/appliance-config.rb", "lib/boxgrinder-core/models/config.rb", "lib/boxgrinder-core/models/task.rb", "lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml", "lib/boxgrinder-core/schemas/appliance_schema_0.9.0.yaml", "lib/boxgrinder-core/schemas/appliance_schema_0.9.6.yaml"]
|
13
|
+
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "boxgrinder-core.gemspec", "lib/boxgrinder-core.rb", "lib/boxgrinder-core/appliance-parser.rb", "lib/boxgrinder-core/appliance-validator.rb", "lib/boxgrinder-core/errors.rb", "lib/boxgrinder-core/helpers/appliance-config-helper.rb", "lib/boxgrinder-core/helpers/appliance-definition-helper.rb", "lib/boxgrinder-core/helpers/appliance-transformation-helper.rb", "lib/boxgrinder-core/helpers/exec-helper.rb", "lib/boxgrinder-core/helpers/log-helper.rb", "lib/boxgrinder-core/models/appliance-config.rb", "lib/boxgrinder-core/models/config.rb", "lib/boxgrinder-core/models/task.rb", "lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml", "lib/boxgrinder-core/schemas/appliance_schema_0.9.0.yaml", "lib/boxgrinder-core/schemas/appliance_schema_0.9.6.yaml", "rubygem-boxgrinder-core.spec", "spec/appliance-parser-spec.rb", "spec/appliance-validator-spec.rb", "spec/helpers/appliance-config-helper-spec.rb", "spec/helpers/appliance-definition-helper-spec.rb", "spec/helpers/appliance-transformation-helper-spec.rb", "spec/helpers/exec-helper-spec.rb", "spec/helpers/log-helper-spec.rb", "spec/models/appliance-config-spec.rb", "spec/models/config-spec.rb", "spec/rspec/ls/one", "spec/rspec/ls/two", "spec/rspec/src/appliances/0.8.x.appl", "spec/rspec/src/appliances/0.9.x-invalid.appl", "spec/rspec/src/appliances/0.9.x.appl", "spec/rspec/src/appliances/comments.appl", "spec/rspec/src/appliances/ephemeral-repo.appl", "spec/rspec/src/appliances/full.appl", "spec/rspec/src/appliances/invalid-yaml.appl", "spec/rspec/src/appliances/legacy.appl", "spec/rspec/src/appliances/repo.appl", "spec/rspec/src/config/empty", "spec/rspec/src/config/valid"]
|
14
14
|
s.homepage = %q{http://boxgrinder.org}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Boxgrinder-core", "--main", "README"]
|
16
16
|
s.require_paths = ["lib"]
|
@@ -37,6 +37,7 @@ module BoxGrinder
|
|
37
37
|
merge_repos
|
38
38
|
merge_default_repos
|
39
39
|
merge_packages
|
40
|
+
merge_files
|
40
41
|
merge_post_operations
|
41
42
|
|
42
43
|
@appliance_config
|
@@ -190,6 +191,23 @@ module BoxGrinder
|
|
190
191
|
end
|
191
192
|
end
|
192
193
|
|
194
|
+
# [BGBUILD-276] Import files into appliance via appliance definition file (Files section)
|
195
|
+
# https://issues.jboss.org/browse/BGBUILD-276
|
196
|
+
def merge_files
|
197
|
+
@appliance_config.files.each_value { |dirs| dirs.clear }
|
198
|
+
|
199
|
+
included = []
|
200
|
+
|
201
|
+
@appliance_configs.each do |appliance_config|
|
202
|
+
next if included.include?(appliance_config)
|
203
|
+
appliance_config.files.each do |dir, files|
|
204
|
+
@appliance_config.files[dir] = [] if @appliance_config.files[dir].nil?
|
205
|
+
files.each { |f| @appliance_config.files[dir] << substitute_vars(f) }
|
206
|
+
end
|
207
|
+
included << appliance_config
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
193
211
|
def merge_post_operations
|
194
212
|
@appliance_config.post.each_value { |cmds| cmds.clear }
|
195
213
|
|
@@ -117,6 +117,7 @@ module BoxGrinder
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
definition['files'].each { |key, value| appliance_config.files[key] = value } unless definition['files'].nil?
|
120
121
|
definition['post'].each { |key, value| appliance_config.post[key] = value } unless definition['post'].nil?
|
121
122
|
|
122
123
|
appliance_config
|
@@ -44,6 +44,7 @@ module BoxGrinder
|
|
44
44
|
@default_repos = true
|
45
45
|
|
46
46
|
@post = {}
|
47
|
+
@files = {}
|
47
48
|
|
48
49
|
@packages = []
|
49
50
|
@appliances = []
|
@@ -58,6 +59,7 @@ module BoxGrinder
|
|
58
59
|
attr_reader :hardware
|
59
60
|
attr_reader :path
|
60
61
|
attr_reader :post
|
62
|
+
attr_reader :files
|
61
63
|
|
62
64
|
attr_accessor :packages
|
63
65
|
attr_accessor :repos
|
@@ -0,0 +1,103 @@
|
|
1
|
+
#0.9.x schema
|
2
|
+
version: 0.9.0
|
3
|
+
type: map
|
4
|
+
mapping:
|
5
|
+
"name":
|
6
|
+
type: str
|
7
|
+
length: { min: 1 }
|
8
|
+
required: yes
|
9
|
+
"summary":
|
10
|
+
type: str
|
11
|
+
length: { min: 1 }
|
12
|
+
"version":
|
13
|
+
type: int
|
14
|
+
"release":
|
15
|
+
type: int
|
16
|
+
"os":
|
17
|
+
type: map
|
18
|
+
mapping:
|
19
|
+
"name":
|
20
|
+
type: str
|
21
|
+
length: { min: 1 }
|
22
|
+
required: yes
|
23
|
+
"version":
|
24
|
+
type: text
|
25
|
+
required: yes
|
26
|
+
"password":
|
27
|
+
type: str
|
28
|
+
"hardware":
|
29
|
+
type: map
|
30
|
+
name: Hardware
|
31
|
+
mapping:
|
32
|
+
"cpus":
|
33
|
+
type: int
|
34
|
+
range: { min: 1, max: 16 }
|
35
|
+
"memory":
|
36
|
+
type: int
|
37
|
+
range: { min: 1 }
|
38
|
+
"partitions":
|
39
|
+
type: map
|
40
|
+
mapping:
|
41
|
+
"=": #No way of providing validation regex for wildcard name.
|
42
|
+
type: map
|
43
|
+
mapping:
|
44
|
+
"size":
|
45
|
+
type: number
|
46
|
+
range: { min: 0.01 }
|
47
|
+
"type":
|
48
|
+
type: str
|
49
|
+
enum: [ext3, ext4]
|
50
|
+
"appliances":
|
51
|
+
type: seq
|
52
|
+
sequence:
|
53
|
+
- type: str
|
54
|
+
pattern: /^[^\/]+$/ #dont support path resolution yet
|
55
|
+
length: { min: 1 }
|
56
|
+
"packages":
|
57
|
+
type: seq
|
58
|
+
sequence:
|
59
|
+
- type: str # Now allowing spaces due to group labels (these map to real groups with no spaces, but confuses users) https://issues.jboss.org/browse/BGBUILD-220
|
60
|
+
pattern: /^[\w\-+.@#\s]+$/ #fedora packaging standard http://bit.ly/h0JN9u (plus a few more, disallow symbols)
|
61
|
+
length: { min: 1 }
|
62
|
+
"default_repos":
|
63
|
+
type: bool
|
64
|
+
default: true
|
65
|
+
"repos":
|
66
|
+
type: seq
|
67
|
+
sequence:
|
68
|
+
- type: map
|
69
|
+
name: Repository
|
70
|
+
mapping:
|
71
|
+
"name":
|
72
|
+
type: str
|
73
|
+
pattern: /^[\w\-+.#]+$/
|
74
|
+
length: { min: 1 }
|
75
|
+
required: yes
|
76
|
+
"baseurl": &pkg-mirror
|
77
|
+
type: str
|
78
|
+
pattern: /(^((http|https|ftp):)(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$|^file:\/\/.+$)/ #customised rfc3986 standard regexp for URIs
|
79
|
+
"mirrorlist": *pkg-mirror
|
80
|
+
"ephemeral":
|
81
|
+
type: bool
|
82
|
+
"files":
|
83
|
+
type: map
|
84
|
+
mapping:
|
85
|
+
"=":
|
86
|
+
type: seq
|
87
|
+
sequence:
|
88
|
+
- type: str
|
89
|
+
length: { min: 1 }
|
90
|
+
"post":
|
91
|
+
type: map
|
92
|
+
mapping:
|
93
|
+
"=":
|
94
|
+
type: seq
|
95
|
+
sequence:
|
96
|
+
- type: str
|
97
|
+
length: { min: 1 }
|
98
|
+
"variables":
|
99
|
+
type: map
|
100
|
+
mapping:
|
101
|
+
"=": # wibble: value
|
102
|
+
type: str
|
103
|
+
length: { min: 1 }
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Summary: Core library for BoxGrinder
|
7
7
|
Name: rubygem-%{gemname}
|
8
|
-
Version: 0.3.
|
8
|
+
Version: 0.3.7
|
9
9
|
Release: 1%{?dist}
|
10
10
|
Group: Development/Languages
|
11
11
|
License: LGPLv3+
|
@@ -76,6 +76,10 @@ popd
|
|
76
76
|
%{gemdir}/doc/%{gemname}-%{version}
|
77
77
|
|
78
78
|
%changelog
|
79
|
+
* Tue Aug 30 2011 Marek Goldmann <mgoldman@redhat.com> - 0.3.7-1
|
80
|
+
- Upstream release: 0.3.7
|
81
|
+
- [BGBUILD-276] Import files into appliance via appliance definition file (Files section)
|
82
|
+
|
79
83
|
* Tue Aug 23 2011 Marek Goldmann <mgoldman@redhat.com> - 0.3.6-1
|
80
84
|
- Upstream release: 0.3.6
|
81
85
|
- [BGBUILD-295] Remove arbitrary 4 CPU limit
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxgrinder-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 7
|
10
|
+
version: 0.3.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-
|
18
|
+
date: 2011-09-02 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -90,6 +90,7 @@ extra_rdoc_files:
|
|
90
90
|
- lib/boxgrinder-core/models/task.rb
|
91
91
|
- lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml
|
92
92
|
- lib/boxgrinder-core/schemas/appliance_schema_0.9.0.yaml
|
93
|
+
- lib/boxgrinder-core/schemas/appliance_schema_0.9.6.yaml
|
93
94
|
files:
|
94
95
|
- CHANGELOG
|
95
96
|
- LICENSE
|
@@ -111,6 +112,7 @@ files:
|
|
111
112
|
- lib/boxgrinder-core/models/task.rb
|
112
113
|
- lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml
|
113
114
|
- lib/boxgrinder-core/schemas/appliance_schema_0.9.0.yaml
|
115
|
+
- lib/boxgrinder-core/schemas/appliance_schema_0.9.6.yaml
|
114
116
|
- rubygem-boxgrinder-core.spec
|
115
117
|
- spec/appliance-parser-spec.rb
|
116
118
|
- spec/appliance-validator-spec.rb
|