omnibus 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/CHANGELOG.md +21 -0
- data/Gemfile +8 -5
- data/README.md +3 -1
- data/Rakefile +20 -13
- data/appveyor.yml +4 -3
- data/bin/omnibus +3 -3
- data/features/commands/manifest.feature +19 -5
- data/features/step_definitions/generator_steps.rb +5 -6
- data/features/support/env.rb +4 -4
- data/lib/omnibus/build_version.rb +14 -14
- data/lib/omnibus/build_version_dsl.rb +3 -3
- data/lib/omnibus/builder.rb +50 -61
- data/lib/omnibus/changelog.rb +2 -2
- data/lib/omnibus/changelog_printer.rb +4 -4
- data/lib/omnibus/cleaner.rb +4 -4
- data/lib/omnibus/cli/base.rb +15 -15
- data/lib/omnibus/cli/cache.rb +13 -13
- data/lib/omnibus/cli/changelog.rb +8 -9
- data/lib/omnibus/cli/publish.rb +12 -13
- data/lib/omnibus/cli.rb +26 -27
- data/lib/omnibus/compressor.rb +6 -6
- data/lib/omnibus/compressors/base.rb +7 -2
- data/lib/omnibus/compressors/dmg.rb +12 -12
- data/lib/omnibus/compressors/null.rb +1 -1
- data/lib/omnibus/compressors/tgz.rb +8 -8
- data/lib/omnibus/config.rb +37 -26
- data/lib/omnibus/core_extensions/open_uri.rb +3 -3
- data/lib/omnibus/core_extensions.rb +1 -1
- data/lib/omnibus/digestable.rb +5 -4
- data/lib/omnibus/download_helpers.rb +7 -6
- data/lib/omnibus/exceptions.rb +29 -13
- data/lib/omnibus/fetcher.rb +0 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
- data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +3 -3
- data/lib/omnibus/generator.rb +60 -47
- data/lib/omnibus/git_cache.rb +33 -22
- data/lib/omnibus/git_repository.rb +5 -5
- data/lib/omnibus/health_check.rb +122 -119
- data/lib/omnibus/instrumentation.rb +1 -1
- data/lib/omnibus/licensing.rb +348 -60
- data/lib/omnibus/logger.rb +12 -9
- data/lib/omnibus/logging.rb +1 -1
- data/lib/omnibus/manifest.rb +4 -4
- data/lib/omnibus/manifest_diff.rb +6 -7
- data/lib/omnibus/manifest_entry.rb +1 -1
- data/lib/omnibus/metadata.rb +36 -36
- data/lib/omnibus/ohai.rb +6 -7
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +37 -28
- data/lib/omnibus/packagers/appx.rb +86 -0
- data/lib/omnibus/packagers/base.rb +21 -18
- data/lib/omnibus/packagers/bff.rb +22 -24
- data/lib/omnibus/packagers/deb.rb +20 -20
- data/lib/omnibus/packagers/ips.rb +18 -17
- data/lib/omnibus/packagers/makeself.rb +7 -7
- data/lib/omnibus/packagers/msi.rb +38 -193
- data/lib/omnibus/packagers/pkg.rb +16 -16
- data/lib/omnibus/packagers/rpm.rb +53 -54
- data/lib/omnibus/packagers/solaris.rb +14 -14
- data/lib/omnibus/packagers/windows_base.rb +192 -0
- data/lib/omnibus/project.rb +45 -43
- data/lib/omnibus/publisher.rb +3 -3
- data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
- data/lib/omnibus/publishers/s3_publisher.rb +7 -7
- data/lib/omnibus/reports.rb +10 -10
- data/lib/omnibus/s3_cache.rb +7 -7
- data/lib/omnibus/s3_helpers.rb +8 -7
- data/lib/omnibus/semantic_version.rb +1 -1
- data/lib/omnibus/software.rb +131 -81
- data/lib/omnibus/sugarable.rb +10 -10
- data/lib/omnibus/templating.rb +5 -5
- data/lib/omnibus/thread_pool.rb +1 -1
- data/lib/omnibus/util.rb +5 -5
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus.rb +65 -65
- data/omnibus.gemspec +34 -32
- data/resources/appx/AppxManifest.xml.erb +18 -0
- data/resources/appx/assets/clear.png +0 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
- data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
- data/spec/functional/builder_spec.rb +149 -150
- data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
- data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
- data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
- data/spec/functional/file_syncer_spec.rb +74 -74
- data/spec/functional/licensing_spec.rb +344 -35
- data/spec/functional/templating_spec.rb +17 -17
- data/spec/spec_helper.rb +20 -20
- data/spec/support/examples.rb +21 -15
- data/spec/support/file_helpers.rb +1 -1
- data/spec/support/git_helpers.rb +37 -37
- data/spec/support/matchers.rb +3 -3
- data/spec/support/ohai_helpers.rb +4 -4
- data/spec/support/path_helpers.rb +2 -2
- data/spec/support/shell_helpers.rb +2 -2
- data/spec/unit/build_version_dsl_spec.rb +5 -5
- data/spec/unit/build_version_spec.rb +63 -63
- data/spec/unit/builder_spec.rb +86 -70
- data/spec/unit/changelog_spec.rb +4 -4
- data/spec/unit/changelogprinter_spec.rb +130 -0
- data/spec/unit/cleanroom_spec.rb +11 -11
- data/spec/unit/compressor_spec.rb +16 -16
- data/spec/unit/compressors/base_spec.rb +6 -6
- data/spec/unit/compressors/dmg_spec.rb +76 -76
- data/spec/unit/compressors/null_spec.rb +4 -4
- data/spec/unit/compressors/tgz_spec.rb +20 -20
- data/spec/unit/config_spec.rb +44 -43
- data/spec/unit/digestable_spec.rb +13 -13
- data/spec/unit/fetcher_spec.rb +11 -12
- data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
- data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
- data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
- data/spec/unit/generator_spec.rb +38 -38
- data/spec/unit/git_cache_spec.rb +56 -54
- data/spec/unit/git_repository_spec.rb +2 -2
- data/spec/unit/health_check_spec.rb +40 -40
- data/spec/unit/library_spec.rb +35 -35
- data/spec/unit/manifest_diff_spec.rb +10 -11
- data/spec/unit/manifest_spec.rb +17 -17
- data/spec/unit/metadata_spec.rb +152 -152
- data/spec/unit/ohai_spec.rb +5 -5
- data/spec/unit/omnibus_spec.rb +31 -31
- data/spec/unit/package_spec.rb +20 -20
- data/spec/unit/packager_spec.rb +48 -42
- data/spec/unit/packagers/appx_spec.rb +165 -0
- data/spec/unit/packagers/base_spec.rb +34 -34
- data/spec/unit/packagers/bff_spec.rb +60 -60
- data/spec/unit/packagers/deb_spec.rb +71 -71
- data/spec/unit/packagers/ips_spec.rb +45 -45
- data/spec/unit/packagers/makeself_spec.rb +22 -22
- data/spec/unit/packagers/msi_spec.rb +141 -147
- data/spec/unit/packagers/pkg_spec.rb +59 -60
- data/spec/unit/packagers/rpm_spec.rb +125 -126
- data/spec/unit/packagers/solaris_spec.rb +52 -52
- data/spec/unit/project_spec.rb +137 -135
- data/spec/unit/publisher_spec.rb +70 -70
- data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
- data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
- data/spec/unit/s3_cacher_spec.rb +34 -34
- data/spec/unit/s3_helpers_spec.rb +6 -6
- data/spec/unit/semantic_version_spec.rb +2 -2
- data/spec/unit/software_spec.rb +346 -384
- data/spec/unit/sugarable_spec.rb +10 -10
- data/spec/unit/util_spec.rb +60 -60
- metadata +54 -6
- data/.rubocop.yml +0 -48
@@ -1,29 +1,29 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Omnibus
|
4
4
|
describe Packager::Solaris do
|
5
5
|
let(:project) do
|
6
6
|
Project.new.tap do |project|
|
7
|
-
project.name(
|
8
|
-
project.homepage(
|
9
|
-
project.install_dir(
|
10
|
-
project.build_version(
|
11
|
-
project.build_iteration(
|
12
|
-
project.maintainer(
|
7
|
+
project.name("project")
|
8
|
+
project.homepage("https://example.com")
|
9
|
+
project.install_dir("/opt/project")
|
10
|
+
project.build_version("1.2.3")
|
11
|
+
project.build_iteration("1")
|
12
|
+
project.maintainer("Chef Software")
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
subject { described_class.new(project) }
|
17
17
|
|
18
|
-
let(:project_root) { File.join(tmp_path,
|
19
|
-
let(:package_dir) { File.join(tmp_path,
|
20
|
-
let(:staging_dir) { File.join(tmp_path,
|
21
|
-
let(:architecture) {
|
18
|
+
let(:project_root) { File.join(tmp_path, "project/root") }
|
19
|
+
let(:package_dir) { File.join(tmp_path, "package/dir") }
|
20
|
+
let(:staging_dir) { File.join(tmp_path, "staging/dir") }
|
21
|
+
let(:architecture) { "i86pc" }
|
22
22
|
|
23
23
|
before do
|
24
24
|
# This is here to allow this unit test to run on windows.
|
25
25
|
allow(File).to receive(:expand_path).and_wrap_original do |m, *args|
|
26
|
-
m.call(*args).sub(/^[A-Za-z]:/,
|
26
|
+
m.call(*args).sub(/^[A-Za-z]:/, "")
|
27
27
|
end
|
28
28
|
Config.project_root(project_root)
|
29
29
|
Config.package_dir(package_dir)
|
@@ -31,44 +31,44 @@ module Omnibus
|
|
31
31
|
allow(subject).to receive(:staging_dir).and_return(staging_dir)
|
32
32
|
create_directory(staging_dir)
|
33
33
|
|
34
|
-
stub_ohai(platform:
|
35
|
-
data[
|
34
|
+
stub_ohai(platform: "solaris2", version: "5.11") do |data|
|
35
|
+
data["kernel"]["machine"] = architecture
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
describe '#id' do
|
40
|
-
it
|
40
|
+
it "is :solaris" do
|
41
41
|
expect(subject.id).to eq(:solaris)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
describe '#package_name' do
|
46
|
-
it
|
47
|
-
expect(subject.package_name).to eq(
|
46
|
+
it "includes the name, version, iteration and architecture" do
|
47
|
+
expect(subject.package_name).to eq("project-1.2.3-1.i386.solaris")
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
describe '#pkgmk_version' do
|
52
|
-
it
|
53
|
-
expect(subject.pkgmk_version).to eq(
|
52
|
+
it "includes the version and iteration" do
|
53
|
+
expect(subject.pkgmk_version).to eq("1.2.3-1")
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
describe '#install_dirname' do
|
58
|
-
it
|
59
|
-
expect(subject.install_dirname).to eq(
|
58
|
+
it "returns the parent directory" do
|
59
|
+
expect(subject.install_dirname).to eq("/opt")
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
63
|
describe '#install_basename' do
|
64
|
-
it
|
65
|
-
expect(subject.install_basename).to eq(
|
64
|
+
it "name of the install directory" do
|
65
|
+
expect(subject.install_basename).to eq("project")
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
describe '#write_scripts' do
|
70
|
-
context
|
71
|
-
let(:scripts) { %w
|
70
|
+
context "when scripts are given" do
|
71
|
+
let(:scripts) { %w{ postinstall postremove } }
|
72
72
|
before do
|
73
73
|
scripts.each do |script_name|
|
74
74
|
create_file("#{project_root}/package-scripts/project/#{script_name}") do
|
@@ -77,7 +77,7 @@ module Omnibus
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
it
|
80
|
+
it "writes the scripts into scripts staging dir" do
|
81
81
|
subject.write_scripts
|
82
82
|
|
83
83
|
scripts.each do |script_name|
|
@@ -88,8 +88,8 @@ module Omnibus
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
context
|
92
|
-
let(:default_scripts) { %w
|
91
|
+
context "when scripts with default omnibus naming are given" do
|
92
|
+
let(:default_scripts) { %w{ postinst postrm } }
|
93
93
|
before do
|
94
94
|
default_scripts.each do |script_name|
|
95
95
|
create_file("#{project_root}/package-scripts/project/#{script_name}") do
|
@@ -98,7 +98,7 @@ module Omnibus
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
-
it
|
101
|
+
it "writes the scripts into scripts staging dir" do
|
102
102
|
subject.write_scripts
|
103
103
|
|
104
104
|
default_scripts.each do |script_name|
|
@@ -112,7 +112,7 @@ module Omnibus
|
|
112
112
|
end
|
113
113
|
|
114
114
|
describe '#write_prototype_file' do
|
115
|
-
let(:prototype_file) { File.join(staging_dir,
|
115
|
+
let(:prototype_file) { File.join(staging_dir, "Prototype") }
|
116
116
|
|
117
117
|
before do
|
118
118
|
allow(subject).to receive(:shellout!)
|
@@ -124,12 +124,12 @@ module Omnibus
|
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
|
-
it
|
127
|
+
it "creates the prototype file" do
|
128
128
|
subject.write_prototype_file
|
129
129
|
contents = File.read(prototype_file)
|
130
130
|
|
131
131
|
expect(contents).to include(
|
132
|
-
<<-EOH.gsub(/^ {12}/,
|
132
|
+
<<-EOH.gsub(/^ {12}/, "")
|
133
133
|
i pkginfo
|
134
134
|
i postinstall
|
135
135
|
i postremove
|
@@ -137,7 +137,7 @@ module Omnibus
|
|
137
137
|
)
|
138
138
|
end
|
139
139
|
|
140
|
-
it
|
140
|
+
it "uses the correct commands" do
|
141
141
|
expect(subject).to receive(:shellout!)
|
142
142
|
.with("cd /opt && find project -print > #{File.join(staging_dir, 'files')}")
|
143
143
|
expect(subject).to receive(:shellout!)
|
@@ -147,16 +147,16 @@ module Omnibus
|
|
147
147
|
subject.write_prototype_file
|
148
148
|
end
|
149
149
|
|
150
|
-
it
|
150
|
+
it "strips out the file with spaces from files.clean" do
|
151
151
|
subject.write_prototype_file
|
152
|
-
contents = File.read(File.join(staging_dir,
|
152
|
+
contents = File.read(File.join(staging_dir, "files.clean"))
|
153
153
|
expect(contents).not_to include("a file with spaces")
|
154
154
|
expect(contents).to include("/foo/bar/baz")
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
158
|
describe '#create_solaris_file' do
|
159
|
-
it
|
159
|
+
it "uses the correct commands" do
|
160
160
|
expect(subject).to receive(:shellout!)
|
161
161
|
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, 'Prototype')}")
|
162
162
|
expect(subject).to receive(:shellout!)
|
@@ -169,16 +169,16 @@ module Omnibus
|
|
169
169
|
end
|
170
170
|
|
171
171
|
describe '#write_pkginfo_file' do
|
172
|
-
let(:pkginfo_file) { File.join(staging_dir,
|
172
|
+
let(:pkginfo_file) { File.join(staging_dir, "pkginfo") }
|
173
173
|
let(:hostname) { Socket.gethostname }
|
174
174
|
let(:now) { Time.now }
|
175
175
|
|
176
|
-
it
|
176
|
+
it "generates the file" do
|
177
177
|
subject.write_pkginfo_file
|
178
178
|
expect(pkginfo_file).to be_a_file
|
179
179
|
end
|
180
180
|
|
181
|
-
it
|
181
|
+
it "has the correct content" do
|
182
182
|
allow(Time).to receive(:now).and_return(now)
|
183
183
|
subject.write_pkginfo_file
|
184
184
|
contents = File.read(pkginfo_file)
|
@@ -205,7 +205,7 @@ module Omnibus
|
|
205
205
|
allow(Dir).to receive(:chdir) { |_, &b| b.call }
|
206
206
|
end
|
207
207
|
|
208
|
-
it
|
208
|
+
it "uses the correct commands" do
|
209
209
|
expect(subject).to receive(:shellout!)
|
210
210
|
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, 'Prototype')}")
|
211
211
|
expect(subject).to receive(:shellout!)
|
@@ -218,27 +218,27 @@ module Omnibus
|
|
218
218
|
end
|
219
219
|
|
220
220
|
describe '#safe_architecture' do
|
221
|
-
context
|
222
|
-
let(:architecture) {
|
221
|
+
context "the architecture is Intel-based" do
|
222
|
+
let(:architecture) { "i86pc" }
|
223
223
|
|
224
|
-
it
|
225
|
-
expect(subject.safe_architecture).to eq(
|
224
|
+
it "returns `i386`" do
|
225
|
+
expect(subject.safe_architecture).to eq("i386")
|
226
226
|
end
|
227
227
|
end
|
228
228
|
|
229
|
-
context
|
230
|
-
let(:architecture) {
|
229
|
+
context "the architecture is SPARC-based" do
|
230
|
+
let(:architecture) { "sun4v" }
|
231
231
|
|
232
|
-
it
|
233
|
-
expect(subject.safe_architecture).to eq(
|
232
|
+
it "returns `sparc`" do
|
233
|
+
expect(subject.safe_architecture).to eq("sparc")
|
234
234
|
end
|
235
235
|
end
|
236
236
|
|
237
|
-
context
|
238
|
-
let(:architecture) {
|
237
|
+
context "anything else" do
|
238
|
+
let(:architecture) { "FOO" }
|
239
239
|
|
240
|
-
it
|
241
|
-
expect(subject.safe_architecture).to eq(
|
240
|
+
it "returns the value from Ohai" do
|
241
|
+
expect(subject.safe_architecture).to eq("FOO")
|
242
242
|
end
|
243
243
|
end
|
244
244
|
end
|