omnibus 6.0.25 → 7.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -3
- data/README.md +25 -9
- data/Rakefile +1 -1
- data/lib/omnibus/build_version_dsl.rb +1 -0
- data/lib/omnibus/builder.rb +10 -7
- 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.rb +1 -0
- data/lib/omnibus/generator_files/Gemfile.erb +2 -2
- data/lib/omnibus/generator_files/README.md.erb +18 -15
- data/lib/omnibus/generator_files/config/projects/project.rb.erb +0 -3
- data/lib/omnibus/generator_files/config/software/preparation.rb.erb +30 -0
- 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 +13 -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 +7 -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/spec_helper.rb +6 -0
- 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/generator_spec.rb +1 -0
- 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 +32 -11
data/lib/omnibus/project.rb
CHANGED
data/lib/omnibus/publisher.rb
CHANGED
@@ -44,10 +44,10 @@ module Omnibus
|
|
44
44
|
# mapping of build to publish platform(s)
|
45
45
|
# @example
|
46
46
|
# {
|
47
|
-
# 'ubuntu-10.04' => [
|
48
|
-
# 'ubuntu-10.04',
|
49
|
-
# 'ubuntu-12.04',
|
50
|
-
# 'ubuntu-14.04',
|
47
|
+
# 'ubuntu-10.04-x86_64' => [
|
48
|
+
# 'ubuntu-10.04-x86_64',
|
49
|
+
# 'ubuntu-12.04-x86_64',
|
50
|
+
# 'ubuntu-14.04-x86_64',
|
51
51
|
# ],
|
52
52
|
# }
|
53
53
|
#
|
@@ -69,39 +69,41 @@ module Omnibus
|
|
69
69
|
#
|
70
70
|
def packages
|
71
71
|
@packages ||= begin
|
72
|
-
publish_packages =
|
72
|
+
publish_packages = []
|
73
73
|
build_packages = FileSyncer.glob(@pattern).map { |path| Package.new(path) }
|
74
74
|
|
75
75
|
if @options[:platform_mappings]
|
76
76
|
# the platform map is a simple hash with publish to build platform mappings
|
77
77
|
@options[:platform_mappings].each_pair do |build_platform, publish_platforms|
|
78
|
-
# Splits `ubuntu-12.04` into `ubuntu
|
79
|
-
build_platform, build_platform_version = build_platform.
|
78
|
+
# Splits `ubuntu-12.04-x86_64` into `ubuntu`, `12.04` and `x86_64`
|
79
|
+
build_platform, build_platform_version, build_architecture = build_platform.split("-")
|
80
80
|
|
81
81
|
# locate the package for the build platform
|
82
82
|
packages = build_packages.select do |p|
|
83
83
|
p.metadata[:platform] == build_platform &&
|
84
|
-
p.metadata[:platform_version] == build_platform_version
|
84
|
+
p.metadata[:platform_version] == build_platform_version &&
|
85
|
+
p.metadata[:arch] == build_architecture
|
85
86
|
end
|
86
87
|
|
87
88
|
if packages.empty?
|
88
89
|
log.warn(log_key) do
|
89
|
-
"Could not locate a package for build platform #{build_platform}-#{build_platform_version}. " \
|
90
|
-
"Publishing will be skipped for: #{publish_platforms.join(
|
90
|
+
"Could not locate a package for build platform #{build_platform}-#{build_platform_version}-#{build_architecture}. " \
|
91
|
+
"Publishing will be skipped for: #{publish_platforms.join(", ")}"
|
91
92
|
end
|
92
93
|
end
|
93
94
|
|
94
95
|
publish_platforms.each do |publish_platform|
|
95
|
-
publish_platform, publish_platform_version = publish_platform.
|
96
|
+
publish_platform, publish_platform_version, publish_architecture = publish_platform.split("-")
|
96
97
|
|
97
98
|
packages.each do |p|
|
98
99
|
# create a copy of our package before mucking with its metadata
|
99
100
|
publish_package = p.dup
|
100
101
|
publish_metadata = p.metadata.dup.to_hash
|
101
102
|
|
102
|
-
# override the platform
|
103
|
+
# override the platform, platform version and architecture in the metadata
|
103
104
|
publish_metadata[:platform] = publish_platform
|
104
105
|
publish_metadata[:platform_version] = publish_platform_version
|
106
|
+
publish_metadata[:arch] = publish_architecture
|
105
107
|
|
106
108
|
# Set the updated metadata on the package object
|
107
109
|
publish_package.metadata = Metadata.new(publish_package, publish_metadata)
|
@@ -65,11 +65,13 @@ module Omnibus
|
|
65
65
|
bucket_name: @options[:bucket],
|
66
66
|
}
|
67
67
|
|
68
|
-
if Config.
|
69
|
-
config[:
|
68
|
+
if Config.publish_s3_iam_role_arn
|
69
|
+
config[:publish_s3_iam_role_arn] = Config.publish_s3_iam_role_arn
|
70
|
+
elsif Config.publish_s3_profile
|
71
|
+
config[:profile] = Config.publish_s3_profile
|
70
72
|
else
|
71
|
-
config[:access_key_id]
|
72
|
-
config[:secret_access_key]
|
73
|
+
config[:access_key_id] = Config.publish_s3_access_key
|
74
|
+
config[:secret_access_key] = Config.publish_s3_secret_key
|
73
75
|
end
|
74
76
|
|
75
77
|
config
|
data/lib/omnibus/s3_cache.rb
CHANGED
@@ -147,7 +147,9 @@ module Omnibus
|
|
147
147
|
force_path_style: Config.s3_force_path_style,
|
148
148
|
}
|
149
149
|
|
150
|
-
if Config.
|
150
|
+
if Config.s3_iam_role_arn
|
151
|
+
config[:iam_role_arn] = Config.s3_iam_role_arn
|
152
|
+
elsif Config.s3_profile
|
151
153
|
config[:profile] = Config.s3_profile
|
152
154
|
else
|
153
155
|
config[:access_key_id] = Config.s3_access_key
|
data/lib/omnibus/s3_helpers.rb
CHANGED
@@ -53,10 +53,7 @@ module Omnibus
|
|
53
53
|
# @return [Aws::S3::Resource]
|
54
54
|
#
|
55
55
|
def client
|
56
|
-
Aws.config.update(
|
57
|
-
region: s3_configuration[:region],
|
58
|
-
credentials: get_credentials
|
59
|
-
)
|
56
|
+
Aws.config.update(region: s3_configuration[:region])
|
60
57
|
|
61
58
|
@s3_client ||= Aws::S3::Resource.new(resource_params)
|
62
59
|
end
|
@@ -70,6 +67,7 @@ module Omnibus
|
|
70
67
|
params = {
|
71
68
|
use_accelerate_endpoint: s3_configuration[:use_accelerate_endpoint],
|
72
69
|
force_path_style: s3_configuration[:force_path_style],
|
70
|
+
credentials: get_credentials,
|
73
71
|
}
|
74
72
|
|
75
73
|
if s3_configuration[:use_accelerate_endpoint]
|
@@ -84,12 +82,14 @@ module Omnibus
|
|
84
82
|
end
|
85
83
|
|
86
84
|
#
|
87
|
-
# Create credentials object based on credential profile or access key
|
85
|
+
# Create credentials object based on AWS IAM role arn, credential profile or access key
|
88
86
|
# parameters for use by the client object.
|
89
87
|
#
|
90
88
|
# @return [Aws::SharedCredentials, Aws::Credentials]
|
91
89
|
def get_credentials
|
92
|
-
if s3_configuration[:
|
90
|
+
if s3_configuration[:iam_role_arn]
|
91
|
+
Aws::AssumeRoleCredentials.new(role_arn: s3_configuration[:iam_role_arn], role_session_name: "omnibus-assume-role-s3-access")
|
92
|
+
elsif s3_configuration[:profile]
|
93
93
|
Aws::SharedCredentials.new(profile_name: s3_configuration[:profile])
|
94
94
|
elsif s3_configuration[:access_key_id] && s3_configuration[:secret_access_key]
|
95
95
|
Aws::Credentials.new(s3_configuration[:access_key_id], s3_configuration[:secret_access_key])
|
data/lib/omnibus/software.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright 2012-
|
2
|
+
# Copyright 2012-2018, Chef Software Inc.
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -205,6 +205,46 @@ module Omnibus
|
|
205
205
|
end
|
206
206
|
expose :maintainer
|
207
207
|
|
208
|
+
#
|
209
|
+
# Sets the bin_dirs where this software installs bins.
|
210
|
+
#
|
211
|
+
# @example
|
212
|
+
# bin_dirs ['/opt/chef-workstation/bin']
|
213
|
+
#
|
214
|
+
# @param [Array<String>] val
|
215
|
+
# the bin_dirs of the software
|
216
|
+
#
|
217
|
+
# @return [Array<String>]
|
218
|
+
#
|
219
|
+
def bin_dirs(val = NULL)
|
220
|
+
if null?(val)
|
221
|
+
@bin_dirs || [windows_safe_path("#{install_dir}/bin"), windows_safe_path("#{install_dir}/embedded/bin")]
|
222
|
+
else
|
223
|
+
@bin_dirs = val
|
224
|
+
end
|
225
|
+
end
|
226
|
+
expose :bin_dirs
|
227
|
+
|
228
|
+
#
|
229
|
+
# Sets the lib_dirs where this software installs libs.
|
230
|
+
#
|
231
|
+
# @example
|
232
|
+
# lib_dirs ['/opt/chef-workstation/bin']
|
233
|
+
#
|
234
|
+
# @param [Array<String>] val
|
235
|
+
# the lib_dirs of the software
|
236
|
+
#
|
237
|
+
# @return [Array<String>]
|
238
|
+
#
|
239
|
+
def lib_dirs(val = NULL)
|
240
|
+
if null?(val)
|
241
|
+
@lib_dirs || [windows_safe_path("#{install_dir}/embedded/lib")]
|
242
|
+
else
|
243
|
+
@lib_dirs = val
|
244
|
+
end
|
245
|
+
end
|
246
|
+
expose :lib_dirs
|
247
|
+
|
208
248
|
#
|
209
249
|
# Add a software dependency to this software.
|
210
250
|
#
|
@@ -305,7 +345,7 @@ module Omnibus
|
|
305
345
|
"only include valid keys. Invalid keys: #{extra_keys.inspect}")
|
306
346
|
end
|
307
347
|
|
308
|
-
duplicate_keys = val.keys &
|
348
|
+
duplicate_keys = val.keys & %i{git file path url}
|
309
349
|
unless duplicate_keys.size < 2
|
310
350
|
raise InvalidValue.new(:source,
|
311
351
|
"not include duplicate keys. Duplicate keys: #{duplicate_keys.inspect}")
|
@@ -509,7 +549,7 @@ module Omnibus
|
|
509
549
|
# the list of currently whitelisted files
|
510
550
|
#
|
511
551
|
def whitelist_file(file)
|
512
|
-
file = Regexp.new(file) unless file.
|
552
|
+
file = Regexp.new(file) unless file.is_a?(Regexp)
|
513
553
|
whitelist_files << file
|
514
554
|
whitelist_files.dup
|
515
555
|
end
|
@@ -668,33 +708,22 @@ module Omnibus
|
|
668
708
|
"ARFLAGS" => "-X64 cru",
|
669
709
|
}
|
670
710
|
when "solaris2"
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
"LDFLAGS" => "-R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -static-libgcc",
|
677
|
-
"CFLAGS" => "-I#{install_dir}/embedded/include -O2",
|
678
|
-
}
|
679
|
-
elsif platform_version.satisfies?(">= 5.11")
|
680
|
-
solaris_flags = {
|
681
|
-
"CC" => "gcc -m64 -static-libgcc",
|
682
|
-
"LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -static-libgcc",
|
683
|
-
"CFLAGS" => "-I#{install_dir}/embedded/include -O2",
|
684
|
-
}
|
685
|
-
end
|
686
|
-
solaris_flags
|
711
|
+
{
|
712
|
+
"CC" => "gcc -m64 -static-libgcc",
|
713
|
+
"LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -static-libgcc",
|
714
|
+
"CFLAGS" => "-I#{install_dir}/embedded/include -O2",
|
715
|
+
}
|
687
716
|
when "freebsd"
|
688
717
|
{
|
689
718
|
"CC" => "clang",
|
690
719
|
"CXX" => "clang++",
|
691
720
|
"LDFLAGS" => "-L#{install_dir}/embedded/lib",
|
692
|
-
"CFLAGS" => "-I#{install_dir}/embedded/include -O2",
|
721
|
+
"CFLAGS" => "-I#{install_dir}/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
693
722
|
}
|
694
723
|
when "suse"
|
695
724
|
suse_flags = {
|
696
725
|
"LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib",
|
697
|
-
"CFLAGS" => "-I#{install_dir}/embedded/include -O2",
|
726
|
+
"CFLAGS" => "-I#{install_dir}/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
698
727
|
}
|
699
728
|
# Enable gcc version 4.8 if it is available
|
700
729
|
if which("gcc-4.8") && platform_version.satisfies?("< 12")
|
@@ -721,7 +750,7 @@ module Omnibus
|
|
721
750
|
else
|
722
751
|
{
|
723
752
|
"LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib",
|
724
|
-
"CFLAGS" => "-I#{install_dir}/embedded/include -O2",
|
753
|
+
"CFLAGS" => "-I#{install_dir}/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
725
754
|
}
|
726
755
|
end
|
727
756
|
|
@@ -987,17 +1016,18 @@ module Omnibus
|
|
987
1016
|
fetcher.version_guid
|
988
1017
|
end
|
989
1018
|
|
1019
|
+
# This is the real version if one exists (nil if there's no real version)
|
1020
|
+
def real_version
|
1021
|
+
@real_version ||= fetcher.version_for_cache || version
|
1022
|
+
end
|
1023
|
+
|
990
1024
|
# Returns the version to be used in cache.
|
991
1025
|
def version_for_cache
|
992
|
-
@version_for_cache ||= if
|
993
|
-
|
994
|
-
elsif version
|
995
|
-
version
|
1026
|
+
@version_for_cache ||= if real_version
|
1027
|
+
real_version
|
996
1028
|
else
|
997
1029
|
log.warn(log_key) do
|
998
|
-
"No version given!
|
999
|
-
"assume the version `0.0.0', but that is most certainly not your " \
|
1000
|
-
"desired behavior. If git caching seems off, this is probably why."
|
1030
|
+
"No version given! Git caching disabled." \
|
1001
1031
|
end
|
1002
1032
|
|
1003
1033
|
"0.0.0"
|
@@ -1070,7 +1100,13 @@ module Omnibus
|
|
1070
1100
|
#
|
1071
1101
|
def build_me(build_wrappers = [])
|
1072
1102
|
if Config.use_git_caching
|
1073
|
-
if
|
1103
|
+
if !real_version
|
1104
|
+
log.info(log_key) do
|
1105
|
+
"Forcing a build because resolved version is nil"
|
1106
|
+
end
|
1107
|
+
execute_build(build_wrappers)
|
1108
|
+
project.dirty!(self) unless project.dirty? # omnibus can only be mildly dirty
|
1109
|
+
elsif project.dirty?
|
1074
1110
|
log.info(log_key) do
|
1075
1111
|
"Building because `#{project.culprit.name}' dirtied the cache"
|
1076
1112
|
end
|
data/lib/omnibus/templating.rb
CHANGED
@@ -73,7 +73,7 @@ module Omnibus
|
|
73
73
|
|
74
74
|
unless options.empty?
|
75
75
|
raise ArgumentError,
|
76
|
-
"Unknown option(s): #{options.keys.map(&:inspect).join(
|
76
|
+
"Unknown option(s): #{options.keys.map(&:inspect).join(", ")}"
|
77
77
|
end
|
78
78
|
|
79
79
|
# String value returned from #render_template_content
|
data/lib/omnibus/util.rb
CHANGED
@@ -80,7 +80,7 @@ module Omnibus
|
|
80
80
|
# populated with results of the command.
|
81
81
|
#
|
82
82
|
def shellout(*args)
|
83
|
-
options = args.last.
|
83
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
84
84
|
options = SHELLOUT_OPTIONS.merge(options)
|
85
85
|
|
86
86
|
command_string = args.join(" ")
|
@@ -158,6 +158,7 @@ module Omnibus
|
|
158
158
|
yield
|
159
159
|
rescue Exception => e
|
160
160
|
raise e unless retried_exceptions.any? { |eclass| e.is_a?(eclass) }
|
161
|
+
|
161
162
|
if retries != 0
|
162
163
|
log.info(log_key) { "Retrying failed #{logstr} due to #{e} (#{retries} retries left)..." }
|
163
164
|
retries -= 1
|
@@ -196,7 +197,7 @@ module Omnibus
|
|
196
197
|
#
|
197
198
|
def compiler_safe_path(*pieces)
|
198
199
|
path = File.join(*pieces)
|
199
|
-
path = path.sub(
|
200
|
+
path = path.sub(%r{^([A-Za-z]):/}, "/\\1/") if ENV["MSYSTEM"]
|
200
201
|
path
|
201
202
|
end
|
202
203
|
|
data/lib/omnibus/version.rb
CHANGED
data/lib/omnibus/whitelist.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
# Copyright 2012-
|
2
|
+
# Copyright 2012-2020, Chef Software Inc.
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
WHITELIST_LIBS = [
|
18
18
|
/ld-linux/,
|
19
|
+
/libanl\.so/,
|
19
20
|
/libc\.so/,
|
20
21
|
/libcrypt\.so/,
|
21
22
|
/libdl/,
|
@@ -33,6 +34,7 @@ WHITELIST_LIBS = [
|
|
33
34
|
].freeze
|
34
35
|
|
35
36
|
ARCH_WHITELIST_LIBS = [
|
37
|
+
/libanl\.so/,
|
36
38
|
/libc\.so/,
|
37
39
|
/libcrypt\.so/,
|
38
40
|
/libdb-5\.3\.so/,
|
@@ -133,8 +135,11 @@ MAC_WHITELIST_LIBS = [
|
|
133
135
|
/libffi\.dylib/,
|
134
136
|
/libncurses\.5\.4\.dylib/,
|
135
137
|
/libiconv/,
|
138
|
+
/libidn2\.0\.dylib/,
|
136
139
|
/libstdc\+\+\.6\.dylib/,
|
137
140
|
/libc\+\+\.1\.dylib/,
|
141
|
+
/libc\+\+\.1\.dylib/,
|
142
|
+
/libzstd\.1\.dylib/,
|
138
143
|
/Security/,
|
139
144
|
].freeze
|
140
145
|
|
data/omnibus.gemspec
CHANGED
@@ -18,25 +18,26 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.files = %w{ LICENSE README.md Rakefile Gemfile } + Dir.glob("*.gemspec") + Dir.glob("{bin,lib,resources,spec}/**/{*,.kitchen*}")
|
19
19
|
gem.bindir = "bin"
|
20
20
|
gem.executables = %w{omnibus}
|
21
|
-
gem.test_files = gem.files.grep(
|
21
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
22
22
|
gem.require_paths = ["lib"]
|
23
23
|
|
24
24
|
gem.add_dependency "aws-sdk-s3", "~> 1"
|
25
25
|
gem.add_dependency "chef-sugar", ">= 3.3"
|
26
|
-
gem.add_dependency "cleanroom",
|
26
|
+
gem.add_dependency "chef-cleanroom", "~> 1.0"
|
27
|
+
gem.add_dependency "ffi", "< 1.13" # 1.13 does not work on Windows: https://github.com/ffi/ffi/issues/784
|
27
28
|
gem.add_dependency "ffi-yajl", "~> 2.2"
|
28
29
|
gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
|
29
|
-
gem.add_dependency "ohai", ">= 13", "<
|
30
|
+
gem.add_dependency "ohai", ">= 13", "< 17"
|
30
31
|
gem.add_dependency "ruby-progressbar", "~> 1.7"
|
31
|
-
gem.add_dependency "thor", "
|
32
|
+
gem.add_dependency "thor", ">= 0.18", "< 2.0"
|
32
33
|
gem.add_dependency "license_scout", "~> 1.0"
|
33
34
|
|
34
35
|
gem.add_dependency "mixlib-versioning"
|
35
36
|
gem.add_dependency "pedump"
|
36
37
|
|
37
|
-
gem.add_development_dependency "artifactory", "~>
|
38
|
+
gem.add_development_dependency "artifactory", "~> 3.0"
|
38
39
|
gem.add_development_dependency "aruba", "~> 0.5"
|
39
|
-
gem.add_development_dependency "chefstyle", "= 0
|
40
|
+
gem.add_development_dependency "chefstyle", "= 1.1.0"
|
40
41
|
gem.add_development_dependency "fauxhai", ">= 5.2"
|
41
42
|
gem.add_development_dependency "rspec", "~> 3.0"
|
42
43
|
gem.add_development_dependency "rspec-json_expectations"
|
data/resources/rpm/signing.erb
CHANGED
@@ -11,25 +11,22 @@ require 'pty'
|
|
11
11
|
|
12
12
|
puts rpm_cmd
|
13
13
|
PTY.spawn(rpm_cmd) do |r, w, pid|
|
14
|
+
# Older versions of rpmsign will prompt right away for the passphrase
|
14
15
|
prompt = r.read(19)
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
STDERR.puts "unexpected output from `#{rpm_cmd}`: '#{prompt}'"
|
20
|
-
Process.kill(:KILL, pid)
|
21
|
-
exit 1
|
17
|
+
if prompt == 'Enter pass phrase: '
|
18
|
+
STDOUT.puts prompt
|
19
|
+
w.write("#{password}\n")
|
22
20
|
end
|
23
21
|
|
24
|
-
STDOUT.puts prompt
|
25
|
-
w.write("#{password}\n")
|
26
|
-
|
27
22
|
# Keep printing output unti the command exits
|
28
23
|
loop do
|
29
24
|
begin
|
30
25
|
line = r.gets
|
31
26
|
puts line
|
32
|
-
if
|
27
|
+
if line =~ /Please enter the passphrase to unlock the OpenPGP secret key:/
|
28
|
+
w.write("#{password}\n")
|
29
|
+
elsif (line =~ /failed/) && !(line =~ /warning:/)
|
33
30
|
STDERR.puts 'RPM signing failure'
|
34
31
|
exit 1
|
35
32
|
end
|
@@ -22,6 +22,7 @@ module Omnibus
|
|
22
22
|
ext = name == "ruby" ? ".exe" : ".bat"
|
23
23
|
source = Bundler.which(name + ext)
|
24
24
|
raise "Could not find #{name} in bundler environment" unless source
|
25
|
+
|
25
26
|
File.open(File.join(embedded_bin_dir, name + ".bat"), "w") do |f|
|
26
27
|
f.write <<-EOH.gsub(/^ {12}/, "")
|
27
28
|
@"#{source}" %*
|
@@ -221,7 +222,7 @@ module Omnibus
|
|
221
222
|
output = capture_logging { subject.build }
|
222
223
|
|
223
224
|
appbundler_path = File.join(embedded_bin_dir, "appbundler")
|
224
|
-
appbundler_path.gsub!(
|
225
|
+
appbundler_path.gsub!(%r{/}, '\\') if windows?
|
225
226
|
expect(output).to include("#{appbundler_path} '#{project_dir}' '#{bin_dir}'")
|
226
227
|
end
|
227
228
|
end
|