omnibus 6.1.4 → 7.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -4
- data/README.md +54 -12
- data/Rakefile +1 -1
- data/bin/omnibus +1 -1
- data/lib/omnibus.rb +2 -2
- data/lib/omnibus/build_version.rb +1 -1
- data/lib/omnibus/build_version_dsl.rb +6 -7
- data/lib/omnibus/builder.rb +10 -9
- data/lib/omnibus/changelog_printer.rb +7 -4
- data/lib/omnibus/cleaner.rb +4 -1
- data/lib/omnibus/cli.rb +2 -2
- data/lib/omnibus/cli/changelog.rb +25 -25
- data/lib/omnibus/compressor.rb +2 -2
- data/lib/omnibus/compressors/base.rb +2 -2
- data/lib/omnibus/compressors/dmg.rb +3 -4
- data/lib/omnibus/compressors/tgz.rb +2 -2
- data/lib/omnibus/config.rb +13 -3
- data/lib/omnibus/core_extensions/open_uri.rb +1 -1
- data/lib/omnibus/digestable.rb +2 -2
- data/lib/omnibus/download_helpers.rb +6 -2
- data/lib/omnibus/fetchers/file_fetcher.rb +1 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +1 -0
- data/lib/omnibus/fetchers/net_fetcher.rb +3 -4
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +1 -1
- data/lib/omnibus/generator.rb +2 -2
- data/lib/omnibus/generator_files/README.md.erb +20 -16
- 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/git_cache.rb +2 -2
- data/lib/omnibus/health_check.rb +3 -1
- data/lib/omnibus/licensing.rb +5 -6
- data/lib/omnibus/logger.rb +3 -2
- data/lib/omnibus/manifest.rb +2 -2
- data/lib/omnibus/metadata.rb +3 -3
- data/lib/omnibus/ohai.rb +1 -1
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +1 -0
- data/lib/omnibus/packagers/appx.rb +1 -2
- data/lib/omnibus/packagers/base.rb +2 -1
- 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 +13 -12
- data/lib/omnibus/packagers/pkg.rb +125 -9
- data/lib/omnibus/packagers/rpm.rb +11 -12
- data/lib/omnibus/packagers/solaris.rb +5 -5
- data/lib/omnibus/packagers/windows_base.rb +7 -6
- data/lib/omnibus/project.rb +3 -2
- data/lib/omnibus/publisher.rb +2 -2
- data/lib/omnibus/publishers/artifactory_publisher.rb +2 -2
- data/lib/omnibus/publishers/s3_publisher.rb +6 -4
- data/lib/omnibus/s3_cache.rb +4 -2
- data/lib/omnibus/s3_helpers.rb +7 -7
- data/lib/omnibus/software.rb +68 -32
- data/lib/omnibus/templating.rb +2 -2
- data/lib/omnibus/thread_pool.rb +0 -2
- data/lib/omnibus/util.rb +4 -3
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus/whitelist.rb +27 -1
- data/omnibus.gemspec +8 -9
- data/resources/ips/doc-transform.erb +1 -0
- data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
- 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/licensing_spec.rb +5 -5
- data/spec/support/examples.rb +3 -4
- data/spec/support/path_helpers.rb +2 -2
- 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/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/ips_spec.rb +1 -0
- 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 +1 -2
- 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 +18 -18
data/lib/omnibus/compressor.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "fileutils"
|
17
|
+
require "fileutils" unless defined?(FileUtils)
|
18
18
|
|
19
19
|
module Omnibus
|
20
20
|
class Compressor::Base < Packager::Base
|
@@ -30,7 +30,7 @@ module Omnibus
|
|
30
30
|
# @param [Project] project
|
31
31
|
#
|
32
32
|
def initialize(project)
|
33
|
-
@project
|
33
|
+
@project = project
|
34
34
|
|
35
35
|
# There can now be multiple packagers per platform
|
36
36
|
# but windows is the only platform that uses multiple
|
@@ -234,8 +234,7 @@ module Omnibus
|
|
234
234
|
pkg_name: packager.package_name,
|
235
235
|
window_bounds: window_bounds,
|
236
236
|
pkg_position: pkg_position,
|
237
|
-
}
|
238
|
-
)
|
237
|
+
})
|
239
238
|
|
240
239
|
Dir.chdir(staging_dir) do
|
241
240
|
shellout! <<-EOH.gsub(/^ {10}/, "")
|
@@ -316,10 +315,10 @@ module Omnibus
|
|
316
315
|
Dir.chdir(staging_dir) do
|
317
316
|
shellout! <<-EOH.gsub(/^ {10}/, "")
|
318
317
|
# Convert the png to an icon
|
319
|
-
sips -i "#{resource_path(
|
318
|
+
sips -i "#{resource_path("icon.png")}"
|
320
319
|
|
321
320
|
# Extract the icon into its own resource
|
322
|
-
DeRez -only icns "#{resource_path(
|
321
|
+
DeRez -only icns "#{resource_path("icon.png")}" > tmp.rsrc
|
323
322
|
|
324
323
|
# Append the icon reosurce to the DMG
|
325
324
|
Rez -append tmp.rsrc -o "#{package_path}"
|
@@ -14,8 +14,8 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "rubygems/package"
|
18
|
-
require "zlib"
|
17
|
+
require "rubygems/package" unless defined?(Gem::Package)
|
18
|
+
require "zlib" unless defined?(Zlib)
|
19
19
|
|
20
20
|
module Omnibus
|
21
21
|
class Compressor::TGZ < Compressor::Base
|
data/lib/omnibus/config.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "singleton"
|
17
|
+
require "singleton" unless defined?(Singleton)
|
18
18
|
|
19
19
|
module Omnibus
|
20
20
|
class Config
|
@@ -285,7 +285,7 @@ module Omnibus
|
|
285
285
|
#
|
286
286
|
# @return [String, nil]
|
287
287
|
default(:s3_access_key) do
|
288
|
-
if s3_profile
|
288
|
+
if s3_profile || s3_iam_role_arn
|
289
289
|
nil
|
290
290
|
else
|
291
291
|
raise MissingRequiredAttribute.new(self, :s3_access_key, "'ABCD1234'")
|
@@ -296,7 +296,7 @@ module Omnibus
|
|
296
296
|
#
|
297
297
|
# @return [String, nil]
|
298
298
|
default(:s3_secret_key) do
|
299
|
-
if s3_profile
|
299
|
+
if s3_profile || s3_iam_role_arn
|
300
300
|
nil
|
301
301
|
else
|
302
302
|
raise MissingRequiredAttribute.new(self, :s3_secret_key, "'EFGH5678'")
|
@@ -308,6 +308,11 @@ module Omnibus
|
|
308
308
|
# @return [String, nil]
|
309
309
|
default(:s3_profile, nil)
|
310
310
|
|
311
|
+
# The AWS IAM role arn to use with S3 caching.
|
312
|
+
#
|
313
|
+
# @return [String, nil]
|
314
|
+
default(:s3_iam_role_arn, nil)
|
315
|
+
|
311
316
|
# The region of the S3 bucket you want to cache software artifacts in.
|
312
317
|
# Defaults to 'us-east-1'
|
313
318
|
#
|
@@ -455,6 +460,11 @@ module Omnibus
|
|
455
460
|
# @return [String, nil]
|
456
461
|
default(:publish_s3_profile, nil)
|
457
462
|
|
463
|
+
# The AWS IAM role arn to use with S3 publisher.
|
464
|
+
#
|
465
|
+
# @return [String, nil]
|
466
|
+
default(:publish_s3_iam_role_arn, nil)
|
467
|
+
|
458
468
|
# Directory pattern for the S3 publisher.
|
459
469
|
# Interpolation of metadata keys is supported.
|
460
470
|
#
|
data/lib/omnibus/digestable.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "open-uri"
|
17
|
+
require "open-uri" unless defined?(OpenURI)
|
18
18
|
require "ruby-progressbar"
|
19
19
|
|
20
20
|
module Omnibus
|
@@ -77,7 +77,11 @@ module Omnibus
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
|
80
|
+
if RUBY_VERSION.to_f < 2.7
|
81
|
+
file = open(from_url, options)
|
82
|
+
else
|
83
|
+
file = URI.open(from_url, options)
|
84
|
+
end
|
81
85
|
# This is a temporary file. Close and flush it before attempting to copy
|
82
86
|
# it over.
|
83
87
|
file.close
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "fileutils"
|
17
|
+
require "fileutils" unless defined?(FileUtils)
|
18
18
|
require "omnibus/download_helpers"
|
19
19
|
|
20
20
|
module Omnibus
|
@@ -31,7 +31,7 @@ module Omnibus
|
|
31
31
|
ALL_EXTENSIONS = WIN_7Z_EXTENSIONS + TAR_EXTENSIONS
|
32
32
|
|
33
33
|
# Digest types used for verifying file checksums
|
34
|
-
DIGESTS =
|
34
|
+
DIGESTS = %i{sha512 sha256 sha1 md5}.freeze
|
35
35
|
|
36
36
|
#
|
37
37
|
# A fetch is required if the downloaded_file (such as a tarball) does not
|
@@ -314,8 +314,7 @@ module Omnibus
|
|
314
314
|
#
|
315
315
|
# @return [[String]]
|
316
316
|
#
|
317
|
-
def extract_command
|
318
|
-
end
|
317
|
+
def extract_command; end
|
319
318
|
|
320
319
|
#
|
321
320
|
# Primitively determine whether we should use gtar or tar to untar a file.
|
data/lib/omnibus/file_syncer.rb
CHANGED
data/lib/omnibus/generator.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "thor"
|
17
|
+
require "thor" unless defined?(Thor)
|
18
18
|
|
19
19
|
module Omnibus
|
20
20
|
class Generator < Thor::Group
|
@@ -73,7 +73,7 @@ module Omnibus
|
|
73
73
|
class << self
|
74
74
|
# Set the source root for Thor
|
75
75
|
def source_root
|
76
|
-
File.expand_path("
|
76
|
+
File.expand_path("generator_files", __dir__)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
@@ -47,8 +47,8 @@ $ bin/omnibus clean <%= config[:name] %> --purge
|
|
47
47
|
### Publish
|
48
48
|
|
49
49
|
Omnibus has a built-in mechanism for releasing to a variety of "backends", such
|
50
|
-
as Amazon S3. You must set the proper credentials in your
|
51
|
-
file or specify them via the command line.
|
50
|
+
as Amazon S3. You must set the proper credentials in your
|
51
|
+
[`omnibus.rb`](omnibus.rb) config file or specify them via the command line.
|
52
52
|
|
53
53
|
```shell
|
54
54
|
$ bin/omnibus publish path/to/*.deb --backend s3
|
@@ -82,37 +82,41 @@ version of every software definition.
|
|
82
82
|
|
83
83
|
Kitchen-based Build Environment
|
84
84
|
-------------------------------
|
85
|
-
Every Omnibus project ships
|
86
|
-
[Berksfile](https://docs.chef.io/berkshelf.html) that will allow you to build
|
87
|
-
|
88
|
-
|
85
|
+
Every Omnibus project ships with a project-specific
|
86
|
+
[Berksfile](https://docs.chef.io/berkshelf.html) that will allow you to build
|
87
|
+
your omnibus projects on all of the platforms listed in the
|
88
|
+
[`.kitchen.yml`](.kitchen.yml). You can add/remove additional platforms as
|
89
|
+
needed by changing the list found in the [`.kitchen.yml`](.kitchen.yml)
|
90
|
+
`platforms` YAML stanza.
|
89
91
|
|
90
92
|
This build environment is designed to get you up-and-running quickly. However,
|
91
|
-
there is nothing that restricts you
|
92
|
-
the [omnibus cookbook](https://github.com/chef-cookbooks/omnibus) to setup
|
93
|
-
|
93
|
+
there is nothing that restricts you from building on other platforms. Simply use
|
94
|
+
the [omnibus cookbook](https://github.com/chef-cookbooks/omnibus) to setup your
|
95
|
+
desired platform and execute the build steps listed above.
|
94
96
|
|
95
97
|
The default build environment requires Test Kitchen and VirtualBox for local
|
96
98
|
development. Test Kitchen also exposes the ability to provision instances using
|
97
99
|
various cloud providers like AWS, DigitalOcean, or OpenStack. For more
|
98
100
|
information, please see the [Test Kitchen documentation](https://kitchen.ci/).
|
99
101
|
|
100
|
-
Once you have tweaked your `.kitchen.yml`
|
101
|
-
liking, you can bring up an
|
102
|
-
command.
|
102
|
+
Once you have tweaked your [`.kitchen.yml`](.kitchen.yml) (or
|
103
|
+
[`.kitchen.local.yml`](.kitchen.local.yml)) to your liking, you can bring up an
|
104
|
+
individual build environment using the `kitchen` command.
|
105
|
+
|
103
106
|
|
104
107
|
```shell
|
105
|
-
$ bin/kitchen converge ubuntu-
|
108
|
+
$ bin/kitchen converge ubuntu-1804
|
106
109
|
```
|
107
110
|
|
108
111
|
Then login to the instance and build the project as described in the Usage
|
109
112
|
section:
|
110
113
|
|
111
114
|
```shell
|
112
|
-
$
|
113
|
-
[vagrant@ubuntu...] $
|
115
|
+
$ bin/kitchen login ubuntu-1804
|
116
|
+
[vagrant@ubuntu...] $ . load-omnibus-toolchain.sh
|
117
|
+
[vagrant@ubuntu...] $ [ -e .bundle ] && sudo chown -R vagrant:vagrant .bundle
|
118
|
+
[vagrant@ubuntu...] $ cd <%= config[:name] %> # or 'cd <%= config[:name] %>/omnibus' if your omnibus project is embedded in your main project
|
114
119
|
[vagrant@ubuntu...] $ bundle install
|
115
|
-
[vagrant@ubuntu...] $ ...
|
116
120
|
[vagrant@ubuntu...] $ bin/omnibus build <%= config[:name] %>
|
117
121
|
```
|
118
122
|
|
@@ -31,10 +31,11 @@
|
|
31
31
|
# Enable S3 asset caching
|
32
32
|
# ------------------------------
|
33
33
|
# use_s3_caching true
|
34
|
-
# s3_access_key
|
35
|
-
# s3_secret_key
|
36
|
-
# s3_profile
|
37
|
-
#
|
34
|
+
# s3_access_key ENV['AWS_ACCESS_KEY_ID']
|
35
|
+
# s3_secret_key ENV['AWS_SECRET_ACCESS_KEY']
|
36
|
+
# s3_profile ENV['AWS_S3_PROFILE']
|
37
|
+
# s3_iam_role_arn ENV['S3_IAM_ROLE_ARN']
|
38
|
+
# s3_bucket ENV['AWS_S3_BUCKET']
|
38
39
|
|
39
40
|
# Customize compiler bits
|
40
41
|
# ------------------------------
|
data/lib/omnibus/git_cache.rb
CHANGED
data/lib/omnibus/health_check.rb
CHANGED
@@ -331,7 +331,7 @@ module Omnibus
|
|
331
331
|
#
|
332
332
|
def health_check_ldd
|
333
333
|
regexp_ends = ".*(" + IGNORED_ENDINGS.map { |e| e.gsub(/\./, '\.') }.join("|") + ")$"
|
334
|
-
regexp_patterns = IGNORED_PATTERNS.map { |e| ".*" + e.gsub(
|
334
|
+
regexp_patterns = IGNORED_PATTERNS.map { |e| ".*" + e.gsub(%r{/}, '\/') + ".*" }.join("|")
|
335
335
|
regexp = regexp_ends + "|" + regexp_patterns
|
336
336
|
|
337
337
|
current_library = nil
|
@@ -428,6 +428,8 @@ module Omnibus
|
|
428
428
|
ARCH_WHITELIST_LIBS
|
429
429
|
when "mac_os_x"
|
430
430
|
MAC_WHITELIST_LIBS
|
431
|
+
when "omnios"
|
432
|
+
OMNIOS_WHITELIST_LIBS
|
431
433
|
when "solaris2"
|
432
434
|
SOLARIS_WHITELIST_LIBS
|
433
435
|
when "smartos"
|
data/lib/omnibus/licensing.rb
CHANGED
@@ -14,8 +14,8 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "uri"
|
18
|
-
require "fileutils"
|
17
|
+
require "uri" unless defined?(URI)
|
18
|
+
require "fileutils" unless defined?(FileUtils)
|
19
19
|
require "omnibus/download_helpers"
|
20
20
|
require "license_scout/collector"
|
21
21
|
require "license_scout/reporter"
|
@@ -130,8 +130,7 @@ module Omnibus
|
|
130
130
|
#
|
131
131
|
# @return [void]
|
132
132
|
#
|
133
|
-
def execute_pre_build(software)
|
134
|
-
end
|
133
|
+
def execute_pre_build(software); end
|
135
134
|
|
136
135
|
# Callback that gets called by Software#build_me after the build is done.
|
137
136
|
# Invokes license copying for the given software. This ensures that
|
@@ -246,7 +245,7 @@ module Omnibus
|
|
246
245
|
|
247
246
|
out << "This product bundles #{name} #{version},\n"
|
248
247
|
out << "which is available under a \"#{license}\" License.\n"
|
249
|
-
|
248
|
+
unless license_files.empty?
|
250
249
|
out << "For details, see:\n"
|
251
250
|
license_files.each do |license_file|
|
252
251
|
out << "#{license_package_location(name, license_file)}\n"
|
@@ -440,7 +439,7 @@ module Omnibus
|
|
440
439
|
|
441
440
|
if Config.fatal_transitive_dependency_licensing_warnings && !transitive_dependency_licensing_warnings.empty?
|
442
441
|
warnings_to_raise << transitive_dependency_licensing_warnings
|
443
|
-
warnings_to_raise << "If you are encountering missing license or missing license file errors for **transitive** dependencies, you can provide overrides for the missing information at https://github.com/chef/license_scout/blob/
|
442
|
+
warnings_to_raise << "If you are encountering missing license or missing license file errors for **transitive** dependencies, you can provide overrides for the missing information at https://github.com/chef/license_scout/blob/1-stable/lib/license_scout/overrides.rb#L93. \n Promote license_scout to Rubygems with `/expeditor promote chef/license_scout:1-stable X.Y.Z` in slack."
|
444
443
|
end
|
445
444
|
|
446
445
|
warnings_to_raise.flatten!
|
data/lib/omnibus/logger.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
module Omnibus
|
18
18
|
class Logger
|
19
19
|
|
20
|
-
require "time"
|
20
|
+
require "time" unless defined?(Time.zone_offset)
|
21
21
|
|
22
22
|
#
|
23
23
|
# The amount of padding on the left column.
|
@@ -102,6 +102,7 @@ module Omnibus
|
|
102
102
|
#
|
103
103
|
def add(severity, progname, &block)
|
104
104
|
return true if io.nil? || severity < level
|
105
|
+
|
105
106
|
message = format_message(severity, progname, yield)
|
106
107
|
MUTEX.synchronize { io.write(message) }
|
107
108
|
true
|
@@ -138,7 +139,7 @@ module Omnibus
|
|
138
139
|
else
|
139
140
|
left = "#{format_severity(severity)} | "
|
140
141
|
end
|
141
|
-
"#{left.rjust(LEFT)}#{Time.now.iso8601
|
142
|
+
"#{left.rjust(LEFT)}#{Time.now.iso8601} | #{message}\n"
|
142
143
|
end
|
143
144
|
|
144
145
|
#
|
data/lib/omnibus/manifest.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require "ffi_yajl"
|
17
|
+
require "ffi_yajl" unless defined?(FFI_Yajl)
|
18
18
|
|
19
19
|
module Omnibus
|
20
20
|
class Manifest
|
@@ -44,7 +44,7 @@ module Omnibus
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def add(name, entry)
|
47
|
-
|
47
|
+
unless entry.is_a? Omnibus::ManifestEntry
|
48
48
|
raise NotAManifestEntry, "#{entry} is not an Omnibus:ManifestEntry"
|
49
49
|
end
|
50
50
|
|