omnibus 6.0.30 → 7.0.13
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.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/README.md +24 -8
- data/Rakefile +1 -1
- data/lib/omnibus/build_version_dsl.rb +1 -0
- data/lib/omnibus/builder.rb +6 -5
- data/lib/omnibus/changelog_printer.rb +7 -4
- data/lib/omnibus/cleaner.rb +3 -0
- data/lib/omnibus/cli.rb +1 -1
- data/lib/omnibus/cli/changelog.rb +24 -24
- data/lib/omnibus/cli/publish.rb +5 -5
- data/lib/omnibus/compressor.rb +2 -2
- data/lib/omnibus/compressors/base.rb +1 -1
- data/lib/omnibus/compressors/dmg.rb +45 -7
- data/lib/omnibus/config.rb +12 -2
- data/lib/omnibus/fetchers/git_fetcher.rb +1 -0
- data/lib/omnibus/fetchers/net_fetcher.rb +2 -3
- data/lib/omnibus/file_syncer.rb +2 -2
- data/lib/omnibus/generator_files/README.md.erb +18 -15
- data/lib/omnibus/generator_files/config/software/preparation.rb.erb +1 -1
- data/lib/omnibus/generator_files/omnibus.rb.erb +5 -4
- data/lib/omnibus/health_check.rb +1 -1
- data/lib/omnibus/licensing.rb +3 -4
- data/lib/omnibus/logger.rb +2 -1
- data/lib/omnibus/manifest.rb +1 -1
- data/lib/omnibus/metadata.rb +2 -2
- data/lib/omnibus/packagers/appx.rb +1 -2
- data/lib/omnibus/packagers/base.rb +1 -0
- data/lib/omnibus/packagers/bff.rb +6 -8
- data/lib/omnibus/packagers/deb.rb +7 -10
- data/lib/omnibus/packagers/ips.rb +3 -6
- data/lib/omnibus/packagers/makeself.rb +1 -2
- data/lib/omnibus/packagers/msi.rb +12 -11
- data/lib/omnibus/packagers/pkg.rb +125 -9
- data/lib/omnibus/packagers/rpm.rb +11 -12
- data/lib/omnibus/packagers/solaris.rb +4 -4
- data/lib/omnibus/packagers/windows_base.rb +7 -6
- data/lib/omnibus/project.rb +1 -0
- data/lib/omnibus/publisher.rb +14 -12
- data/lib/omnibus/publishers/s3_publisher.rb +6 -4
- data/lib/omnibus/s3_cache.rb +3 -1
- data/lib/omnibus/s3_helpers.rb +6 -6
- data/lib/omnibus/software.rb +66 -30
- data/lib/omnibus/templating.rb +1 -1
- data/lib/omnibus/util.rb +3 -2
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus/whitelist.rb +6 -1
- data/omnibus.gemspec +6 -6
- data/resources/rpm/signing.erb +7 -10
- data/spec/functional/builder_spec.rb +2 -1
- data/spec/functional/fetchers/file_fetcher_spec.rb +4 -4
- data/spec/functional/fetchers/git_fetcher_spec.rb +4 -4
- data/spec/functional/fetchers/net_fetcher_spec.rb +5 -6
- data/spec/functional/fetchers/path_fetcher_spec.rb +4 -4
- data/spec/functional/file_syncer_spec.rb +42 -0
- data/spec/functional/licensing_spec.rb +5 -5
- data/spec/support/examples.rb +3 -4
- data/spec/unit/builder_spec.rb +9 -9
- data/spec/unit/changelogprinter_spec.rb +8 -6
- data/spec/unit/compressor_spec.rb +3 -3
- data/spec/unit/compressors/dmg_spec.rb +43 -4
- data/spec/unit/fetchers/net_fetcher_spec.rb +16 -17
- data/spec/unit/health_check_spec.rb +2 -6
- data/spec/unit/library_spec.rb +2 -1
- data/spec/unit/manifest_diff_spec.rb +2 -2
- data/spec/unit/manifest_spec.rb +1 -1
- data/spec/unit/metadata_spec.rb +9 -11
- data/spec/unit/omnibus_spec.rb +1 -1
- data/spec/unit/packagers/bff_spec.rb +2 -2
- data/spec/unit/packagers/msi_spec.rb +2 -2
- data/spec/unit/packagers/pkg_spec.rb +354 -0
- data/spec/unit/packagers/pkgsrc_spec.rb +1 -1
- data/spec/unit/packagers/solaris_spec.rb +7 -7
- data/spec/unit/project_spec.rb +2 -2
- data/spec/unit/publisher_spec.rb +8 -9
- data/spec/unit/publishers/artifactory_publisher_spec.rb +2 -4
- data/spec/unit/publishers/s3_publisher_spec.rb +2 -4
- data/spec/unit/s3_cacher_spec.rb +19 -6
- data/spec/unit/s3_helpers_spec.rb +22 -3
- data/spec/unit/software_spec.rb +72 -42
- data/spec/unit/util_spec.rb +1 -2
- metadata +17 -11
@@ -109,6 +109,158 @@ module Omnibus
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
+
describe "#sign_software_libs_and_bins" do
|
113
|
+
context "when pkg signing is disabled" do
|
114
|
+
it "does not sign anything" do
|
115
|
+
expect(subject).not_to receive(:sign_binary)
|
116
|
+
expect(subject).not_to receive(:sign_library)
|
117
|
+
subject.sign_software_libs_and_bins
|
118
|
+
end
|
119
|
+
|
120
|
+
it "returns an empty set" do
|
121
|
+
expect(subject.sign_software_libs_and_bins).to be_nil
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
context "when pkg signing is enabled" do
|
126
|
+
before do
|
127
|
+
subject.signing_identity("My Special Identity")
|
128
|
+
end
|
129
|
+
|
130
|
+
context "without software" do
|
131
|
+
it "does not sign anything" do
|
132
|
+
expect(subject).not_to receive(:sign_binary)
|
133
|
+
expect(subject).not_to receive(:sign_library)
|
134
|
+
subject.sign_software_libs_and_bins
|
135
|
+
end
|
136
|
+
|
137
|
+
it "returns an empty set" do
|
138
|
+
expect(subject.sign_software_libs_and_bins).to eq(Set.new)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
context "project with software" do
|
143
|
+
let(:software) do
|
144
|
+
Software.new(project).tap do |software|
|
145
|
+
software.name("software-full-name")
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
before do
|
150
|
+
allow(project).to receive(:softwares).and_return([software])
|
151
|
+
end
|
152
|
+
|
153
|
+
context "with empty bin_dirs and lib_dirs" do
|
154
|
+
before do
|
155
|
+
allow(software).to receive(:lib_dirs).and_return([])
|
156
|
+
allow(software).to receive(:bin_dirs).and_return([])
|
157
|
+
end
|
158
|
+
|
159
|
+
it "does not sign anything" do
|
160
|
+
expect(subject).not_to receive(:sign_binary)
|
161
|
+
expect(subject).not_to receive(:sign_library)
|
162
|
+
subject.sign_software_libs_and_bins
|
163
|
+
end
|
164
|
+
|
165
|
+
it "returns an empty set" do
|
166
|
+
expect(subject.sign_software_libs_and_bins).to eq(Set.new)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
context "with default bin_dirs and lib_dirs" do
|
171
|
+
context "with binaries" do
|
172
|
+
let(:bin) { "/opt/#{project.name}/bin/test_bin" }
|
173
|
+
let(:embedded_bin) { "/opt/#{project.name}/embedded/bin/test_bin" }
|
174
|
+
before do
|
175
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/bin/*").and_return([bin])
|
176
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/embedded/bin/*").and_return([embedded_bin])
|
177
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/embedded/lib/*").and_return([])
|
178
|
+
allow(subject).to receive(:is_binary?).with(bin).and_return(true)
|
179
|
+
allow(subject).to receive(:is_binary?).with(embedded_bin).and_return(true)
|
180
|
+
allow(subject).to receive(:find_linked_libs).with(bin).and_return([])
|
181
|
+
allow(subject).to receive(:find_linked_libs).with(embedded_bin).and_return([])
|
182
|
+
allow(subject).to receive(:sign_binary).with(bin, true)
|
183
|
+
allow(subject).to receive(:sign_binary).with(embedded_bin, true)
|
184
|
+
end
|
185
|
+
|
186
|
+
it "signs the binaries" do
|
187
|
+
expect(subject).to receive(:sign_binary).with(bin, true)
|
188
|
+
expect(subject).to receive(:sign_binary).with(embedded_bin, true)
|
189
|
+
subject.sign_software_libs_and_bins
|
190
|
+
end
|
191
|
+
|
192
|
+
it "returns a set with the signed binaries" do
|
193
|
+
expect(subject.sign_software_libs_and_bins).to eq(Set.new [bin, embedded_bin])
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
context "with library" do
|
198
|
+
let(:lib) { "/opt/#{project.name}/embedded/lib/test_lib" }
|
199
|
+
before do
|
200
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/bin/*").and_return([])
|
201
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/embedded/bin/*").and_return([])
|
202
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/embedded/lib/*").and_return([lib])
|
203
|
+
allow(subject).to receive(:is_macho?).with(lib).and_return(true)
|
204
|
+
allow(subject).to receive(:find_linked_libs).with(lib).and_return([])
|
205
|
+
allow(subject).to receive(:sign_library).with(lib)
|
206
|
+
end
|
207
|
+
|
208
|
+
it "signs the library" do
|
209
|
+
expect(subject).to receive(:sign_library).with(lib)
|
210
|
+
subject.sign_software_libs_and_bins
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
context "with binaries and libraries with linked libs" do
|
215
|
+
let(:bin) { "/opt/#{project.name}/bin/test_bin" }
|
216
|
+
let(:bin2) { "/opt/#{project.name}/bin/test_bin2" }
|
217
|
+
let(:embedded_bin) { "/opt/#{project.name}/embedded/bin/test_bin" }
|
218
|
+
let(:lib) { "/opt/#{project.name}/embedded/lib/test_lib" }
|
219
|
+
let(:lib2) { "/opt/#{project.name}/embedded/lib/test_lib2" }
|
220
|
+
before do
|
221
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/bin/*").and_return([bin, bin2])
|
222
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/embedded/bin/*").and_return([embedded_bin])
|
223
|
+
allow(Dir).to receive(:[]).with("/opt/#{project.name}/embedded/lib/*").and_return([lib])
|
224
|
+
allow(subject).to receive(:is_binary?).with(bin).and_return(true)
|
225
|
+
allow(subject).to receive(:is_binary?).with(bin2).and_return(true)
|
226
|
+
allow(subject).to receive(:is_binary?).with(embedded_bin).and_return(true)
|
227
|
+
allow(subject).to receive(:is_macho?).with(lib).and_return(true)
|
228
|
+
allow(subject).to receive(:is_macho?).with(lib2).and_return(true)
|
229
|
+
allow(subject).to receive(:find_linked_libs).with(bin).and_return([lib2])
|
230
|
+
allow(subject).to receive(:find_linked_libs).with(bin2).and_return([])
|
231
|
+
allow(subject).to receive(:find_linked_libs).with(embedded_bin).and_return([])
|
232
|
+
allow(subject).to receive(:find_linked_libs).with(lib).and_return([])
|
233
|
+
allow(subject).to receive(:find_linked_libs).with(lib2).and_return([])
|
234
|
+
allow(subject).to receive(:sign_binary).with(bin, true)
|
235
|
+
allow(subject).to receive(:sign_binary).with(bin2, true)
|
236
|
+
allow(subject).to receive(:sign_binary).with(embedded_bin, true)
|
237
|
+
allow(subject).to receive(:sign_library).with(lib)
|
238
|
+
allow(subject).to receive(:sign_library).with(lib2)
|
239
|
+
allow(Digest::SHA256).to receive(:file).with(bin).and_return(Digest::SHA256.new.update(bin))
|
240
|
+
allow(Digest::SHA256).to receive(:file).with(bin2).and_return(Digest::SHA256.new.update(bin2))
|
241
|
+
allow(Digest::SHA256).to receive(:file).with(embedded_bin).and_return(Digest::SHA256.new.update(embedded_bin))
|
242
|
+
allow(Digest::SHA256).to receive(:file).with(lib).and_return(Digest::SHA256.new.update(lib))
|
243
|
+
allow(Digest::SHA256).to receive(:file).with(lib2).and_return(Digest::SHA256.new.update(lib2))
|
244
|
+
end
|
245
|
+
|
246
|
+
it "signs the binaries" do
|
247
|
+
expect(subject).to receive(:sign_binary).with(bin, true)
|
248
|
+
expect(subject).to receive(:sign_binary).with(bin2, true)
|
249
|
+
expect(subject).to receive(:sign_binary).with(embedded_bin, true)
|
250
|
+
subject.sign_software_libs_and_bins
|
251
|
+
end
|
252
|
+
|
253
|
+
it "signs the libraries" do
|
254
|
+
expect(subject).to receive(:sign_library).with(lib)
|
255
|
+
expect(subject).to receive(:sign_library).with(lib2)
|
256
|
+
subject.sign_software_libs_and_bins
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
112
264
|
describe "#build_component_pkg" do
|
113
265
|
it "executes the pkgbuild command" do
|
114
266
|
expect(subject).to receive(:shellout!).with <<-EOH.gsub(/^ {10}/, "")
|
@@ -118,6 +270,7 @@ module Omnibus
|
|
118
270
|
--scripts "#{staging_dir}/Scripts" \\
|
119
271
|
--root "/opt/project-full-name" \\
|
120
272
|
--install-location "/opt/project-full-name" \\
|
273
|
+
--preserve-xattr \\
|
121
274
|
"project-full-name-core.pkg"
|
122
275
|
EOH
|
123
276
|
|
@@ -267,5 +420,206 @@ module Omnibus
|
|
267
420
|
end
|
268
421
|
end
|
269
422
|
end
|
423
|
+
|
424
|
+
describe "#find_linked_libs" do
|
425
|
+
context "with linked libs" do
|
426
|
+
let(:file) { "/opt/#{project.name}/embedded/bin/test_bin" }
|
427
|
+
let(:stdout) do
|
428
|
+
<<~EOH
|
429
|
+
/opt/#{project.name}/embedded/bin/test_bin:
|
430
|
+
/opt/#{project.name}/embedded/lib/lib.dylib (compatibility version 7.0.0, current version 7.4.0)
|
431
|
+
/opt/#{project.name}/embedded/lib/lib.6.dylib (compatibility version 7.0.0, current version 7.4.0)
|
432
|
+
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
|
433
|
+
EOH
|
434
|
+
end
|
435
|
+
let(:shellout) { Mixlib::ShellOut.new }
|
436
|
+
|
437
|
+
before do
|
438
|
+
allow(shellout).to receive(:run_command)
|
439
|
+
allow(shellout).to receive(:stdout)
|
440
|
+
.and_return(stdout)
|
441
|
+
allow(subject).to receive(:shellout!)
|
442
|
+
.with("otool -L #{file}")
|
443
|
+
.and_return(shellout)
|
444
|
+
end
|
445
|
+
|
446
|
+
it "returns empty array" do
|
447
|
+
expect(subject.find_linked_libs(file)).to eq([
|
448
|
+
"/opt/#{project.name}/embedded/lib/lib.dylib",
|
449
|
+
"/opt/#{project.name}/embedded/lib/lib.6.dylib",
|
450
|
+
])
|
451
|
+
end
|
452
|
+
end
|
453
|
+
|
454
|
+
context "with only system linked libs" do
|
455
|
+
let(:file) { "/opt/#{project.name}/embedded/lib/lib.dylib" }
|
456
|
+
let(:stdout) do
|
457
|
+
<<~EOH
|
458
|
+
/opt/#{project.name}/embedded/lib/lib.dylib:
|
459
|
+
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
|
460
|
+
EOH
|
461
|
+
end
|
462
|
+
let(:shellout) { Mixlib::ShellOut.new }
|
463
|
+
before do
|
464
|
+
allow(shellout).to receive(:run_command)
|
465
|
+
allow(shellout).to receive(:stdout)
|
466
|
+
.and_return(stdout)
|
467
|
+
allow(subject).to receive(:shellout!)
|
468
|
+
.with("otool -L #{file}")
|
469
|
+
.and_return(shellout)
|
470
|
+
end
|
471
|
+
|
472
|
+
it "returns empty array" do
|
473
|
+
expect(subject.find_linked_libs(file)).to eq([])
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
context "file is just a file" do
|
478
|
+
let(:file) { "/opt/#{project.name}/embedded/lib/file.rb" }
|
479
|
+
let(:shellout) { Mixlib::ShellOut.new }
|
480
|
+
before do
|
481
|
+
allow(shellout).to receive(:run_command)
|
482
|
+
allow(shellout).to receive(:stdout)
|
483
|
+
.and_return("#{file}: is not an object file")
|
484
|
+
allow(subject).to receive(:shellout!)
|
485
|
+
.with("otool -L #{file}")
|
486
|
+
.and_return(shellout)
|
487
|
+
end
|
488
|
+
|
489
|
+
it "returns empty array" do
|
490
|
+
expect(subject.find_linked_libs(file)).to eq([])
|
491
|
+
end
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
495
|
+
describe "#is_binary?" do
|
496
|
+
context "when is a file, executable, and not a symlink" do
|
497
|
+
before do
|
498
|
+
allow(File).to receive(:file?).with("file").and_return(true)
|
499
|
+
allow(File).to receive(:executable?).with("file").and_return(true)
|
500
|
+
allow(File).to receive(:symlink?).with("file").and_return(false)
|
501
|
+
end
|
502
|
+
|
503
|
+
it "returns true" do
|
504
|
+
expect(subject.is_binary?("file")).to be true
|
505
|
+
end
|
506
|
+
end
|
507
|
+
|
508
|
+
context "when not a file" do
|
509
|
+
before do
|
510
|
+
allow(File).to receive(:file?).with("file").and_return(false)
|
511
|
+
allow(File).to receive(:executable?).with("file").and_return(true)
|
512
|
+
allow(File).to receive(:symlink?).with("file").and_return(false)
|
513
|
+
end
|
514
|
+
|
515
|
+
it "returns false" do
|
516
|
+
expect(subject.is_binary?("file")).to be false
|
517
|
+
end
|
518
|
+
end
|
519
|
+
|
520
|
+
context "when not an executable" do
|
521
|
+
it "returns false" do
|
522
|
+
allow(File).to receive(:file?).with("file").and_return(true)
|
523
|
+
allow(File).to receive(:executable?).with("file").and_return(false)
|
524
|
+
allow(File).to receive(:symlink?).with("file").and_return(false)
|
525
|
+
expect(subject.is_binary?("file")).to be false
|
526
|
+
end
|
527
|
+
end
|
528
|
+
|
529
|
+
context "when is symlink" do
|
530
|
+
it "returns false" do
|
531
|
+
allow(File).to receive(:file?).with("file").and_return(true)
|
532
|
+
allow(File).to receive(:executable?).with("file").and_return(true)
|
533
|
+
allow(File).to receive(:symlink?).with("file").and_return(true)
|
534
|
+
expect(subject.is_binary?("file")).to be false
|
535
|
+
end
|
536
|
+
end
|
537
|
+
end
|
538
|
+
|
539
|
+
describe "#is_macho?" do
|
540
|
+
let(:shellout) { Mixlib::ShellOut.new }
|
541
|
+
|
542
|
+
context "when is a Mach-O library" do
|
543
|
+
before do
|
544
|
+
allow(subject).to receive(:is_binary?).with("file").and_return(true)
|
545
|
+
expect(subject).to receive(:shellout!).with("file file").and_return(shellout)
|
546
|
+
allow(shellout).to receive(:stdout)
|
547
|
+
.and_return("file: Mach-O 64-bit dynamically linked shared library x86_64")
|
548
|
+
end
|
549
|
+
|
550
|
+
it "returns true" do
|
551
|
+
expect(subject.is_macho?("file")).to be true
|
552
|
+
end
|
553
|
+
end
|
554
|
+
|
555
|
+
context "when is a Mach-O Bundle" do
|
556
|
+
before do
|
557
|
+
allow(subject).to receive(:is_binary?).with("file").and_return(true)
|
558
|
+
expect(subject).to receive(:shellout!).with("file file").and_return(shellout)
|
559
|
+
allow(shellout).to receive(:stdout)
|
560
|
+
.and_return("file: Mach-O 64-bit bundle x86_64")
|
561
|
+
end
|
562
|
+
|
563
|
+
it "returns true" do
|
564
|
+
expect(subject.is_macho?("file")).to be true
|
565
|
+
end
|
566
|
+
end
|
567
|
+
|
568
|
+
context "when is not a Mach-O Bundle or Mach-O library" do
|
569
|
+
before do
|
570
|
+
allow(subject).to receive(:is_binary?).with("file").and_return(true)
|
571
|
+
expect(subject).to receive(:shellout!).with("file file").and_return(shellout)
|
572
|
+
allow(shellout).to receive(:stdout)
|
573
|
+
.and_return("file: ASCII text")
|
574
|
+
end
|
575
|
+
|
576
|
+
it "returns true" do
|
577
|
+
expect(subject.is_macho?("file")).to be false
|
578
|
+
end
|
579
|
+
end
|
580
|
+
end
|
581
|
+
|
582
|
+
describe "#sign_library" do
|
583
|
+
before do
|
584
|
+
subject.signing_identity("My Special Identity")
|
585
|
+
end
|
586
|
+
|
587
|
+
it "calls sign_binary without hardened runtime" do
|
588
|
+
expect(subject).to receive(:sign_binary).with("file")
|
589
|
+
subject.sign_library("file")
|
590
|
+
end
|
591
|
+
end
|
592
|
+
|
593
|
+
describe "#sign_binary" do
|
594
|
+
before do
|
595
|
+
subject.signing_identity("My Special Identity")
|
596
|
+
end
|
597
|
+
|
598
|
+
it "it signs the binary without hardened runtime" do
|
599
|
+
expect(subject).to receive(:shellout!)
|
600
|
+
.with("codesign -s '#{subject.signing_identity}' 'file' --force\n")
|
601
|
+
subject.sign_binary("file")
|
602
|
+
end
|
603
|
+
|
604
|
+
context "with hardened runtime" do
|
605
|
+
it "it signs the binary with hardened runtime" do
|
606
|
+
expect(subject).to receive(:shellout!)
|
607
|
+
.with("codesign -s '#{subject.signing_identity}' 'file' --options=runtime --force\n")
|
608
|
+
subject.sign_binary("file", true)
|
609
|
+
end
|
610
|
+
|
611
|
+
context "with entitlements" do
|
612
|
+
let(:entitlements_file) { File.join(tmp_path, "project-full-name/resources/project-full-name/pkg/entitlements.plist") }
|
613
|
+
|
614
|
+
it "it signs the binary with the entitlements" do
|
615
|
+
allow(subject).to receive(:resource_path).with("entitlements.plist").and_return(entitlements_file)
|
616
|
+
allow(File).to receive(:exist?).with(entitlements_file).and_return(true)
|
617
|
+
expect(subject).to receive(:shellout!)
|
618
|
+
.with("codesign -s '#{subject.signing_identity}' 'file' --options=runtime --entitlements #{entitlements_file} --force\n")
|
619
|
+
subject.sign_binary("file", true)
|
620
|
+
end
|
621
|
+
end
|
622
|
+
end
|
623
|
+
end
|
270
624
|
end
|
271
625
|
end
|
@@ -70,7 +70,7 @@ module Omnibus
|
|
70
70
|
expect(subject).to receive(:shellout!)
|
71
71
|
.with "cd #{project.install_dir} && find . -type l -or -type f | sort >> #{staging_dir}/packlist"
|
72
72
|
subject.write_packlist
|
73
|
-
expect(File.read("#{staging_dir}/packlist")).to match(
|
73
|
+
expect(File.read("#{staging_dir}/packlist")).to match(%r{@pkgdir /opt/project})
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
@@ -139,11 +139,11 @@ module Omnibus
|
|
139
139
|
|
140
140
|
it "uses the correct commands" do
|
141
141
|
expect(subject).to receive(:shellout!)
|
142
|
-
.with("cd /opt && find project -print > #{File.join(staging_dir,
|
142
|
+
.with("cd /opt && find project -print > #{File.join(staging_dir, "files")}")
|
143
143
|
expect(subject).to receive(:shellout!)
|
144
|
-
.with("cd /opt && pkgproto < #{File.join(staging_dir,
|
144
|
+
.with("cd /opt && pkgproto < #{File.join(staging_dir, "files.clean")} > #{File.join(staging_dir, "Prototype.files")}")
|
145
145
|
expect(subject).to receive(:shellout!)
|
146
|
-
.with("awk '{ $5 = \"root\"; $6 = \"root\"; print }' < #{File.join(staging_dir,
|
146
|
+
.with("awk '{ $5 = \"root\"; $6 = \"root\"; print }' < #{File.join(staging_dir, "Prototype.files")} >> #{File.join(staging_dir, "Prototype")}")
|
147
147
|
subject.write_prototype_file
|
148
148
|
end
|
149
149
|
|
@@ -158,11 +158,11 @@ module Omnibus
|
|
158
158
|
describe "#create_solaris_file" do
|
159
159
|
it "uses the correct commands" do
|
160
160
|
expect(subject).to receive(:shellout!)
|
161
|
-
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir,
|
161
|
+
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, "Prototype")}")
|
162
162
|
expect(subject).to receive(:shellout!)
|
163
163
|
.with("pkgchk -vd #{staging_dir} project")
|
164
164
|
expect(subject).to receive(:shellout!)
|
165
|
-
.with("pkgtrans #{staging_dir} #{File.join(package_dir,
|
165
|
+
.with("pkgtrans #{staging_dir} #{File.join(package_dir, "project-1.2.3-1.i386.solaris")} project")
|
166
166
|
|
167
167
|
subject.create_solaris_file
|
168
168
|
end
|
@@ -207,11 +207,11 @@ module Omnibus
|
|
207
207
|
|
208
208
|
it "uses the correct commands" do
|
209
209
|
expect(subject).to receive(:shellout!)
|
210
|
-
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir,
|
210
|
+
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, "Prototype")}")
|
211
211
|
expect(subject).to receive(:shellout!)
|
212
212
|
.with("pkgchk -vd #{staging_dir} project")
|
213
213
|
expect(subject).to receive(:shellout!)
|
214
|
-
.with("pkgtrans #{staging_dir} #{File.join(package_dir,
|
214
|
+
.with("pkgtrans #{staging_dir} #{File.join(package_dir, "project-1.2.3-1.i386.solaris")} project")
|
215
215
|
|
216
216
|
subject.create_solaris_file
|
217
217
|
end
|
data/spec/unit/project_spec.rb
CHANGED
@@ -202,7 +202,7 @@ module Omnibus
|
|
202
202
|
end
|
203
203
|
|
204
204
|
describe "#build_iteration" do
|
205
|
-
let(:fauxhai_options) {
|
205
|
+
let(:fauxhai_options) { {} }
|
206
206
|
|
207
207
|
before { stub_ohai(fauxhai_options) }
|
208
208
|
|
@@ -340,7 +340,7 @@ module Omnibus
|
|
340
340
|
subject.compress(:tgz)
|
341
341
|
|
342
342
|
expect(Compressor).to receive(:for_current_system)
|
343
|
-
.with(
|
343
|
+
.with(%i{dmg tgz})
|
344
344
|
.and_call_original
|
345
345
|
|
346
346
|
subject.compressor
|
data/spec/unit/publisher_spec.rb
CHANGED
@@ -47,9 +47,9 @@ module Omnibus
|
|
47
47
|
let(:options) do
|
48
48
|
{
|
49
49
|
platform_mappings: {
|
50
|
-
"ubuntu-12.04" => [
|
51
|
-
"ubuntu-12.04",
|
52
|
-
"ubuntu-14.04",
|
50
|
+
"ubuntu-12.04-x86_64" => [
|
51
|
+
"ubuntu-12.04-x86_64",
|
52
|
+
"ubuntu-14.04-x86_64",
|
53
53
|
],
|
54
54
|
},
|
55
55
|
}
|
@@ -133,8 +133,7 @@ module Omnibus
|
|
133
133
|
license: "Apache-2.0",
|
134
134
|
},
|
135
135
|
},
|
136
|
-
}
|
137
|
-
)
|
136
|
+
})
|
138
137
|
end
|
139
138
|
|
140
139
|
before do
|
@@ -155,9 +154,9 @@ module Omnibus
|
|
155
154
|
let(:options) do
|
156
155
|
{
|
157
156
|
platform_mappings: {
|
158
|
-
"ubuntu-10.04" => [
|
159
|
-
"ubuntu-12.04",
|
160
|
-
"ubuntu-14.04",
|
157
|
+
"ubuntu-10.04-x86_64" => [
|
158
|
+
"ubuntu-12.04-x86_64",
|
159
|
+
"ubuntu-14.04-x86_64",
|
161
160
|
],
|
162
161
|
},
|
163
162
|
}
|
@@ -165,7 +164,7 @@ module Omnibus
|
|
165
164
|
|
166
165
|
it "prints a warning" do
|
167
166
|
output = capture_logging { subject.packages }
|
168
|
-
expect(output).to include("Could not locate a package for build platform ubuntu-10.04. Publishing will be skipped for: ubuntu-12.04, ubuntu-14.04")
|
167
|
+
expect(output).to include("Could not locate a package for build platform ubuntu-10.04-x86_64. Publishing will be skipped for: ubuntu-12.04-x86_64, ubuntu-14.04-x86_64")
|
169
168
|
end
|
170
169
|
end
|
171
170
|
end
|