omnibus 6.0.30 → 6.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed65ad83fa1ddd7ebc9be5254d38054d3de93cc8ba6f681538a2d3bd25356b46
4
- data.tar.gz: c848e02cedec959d16e647abb94fe08fb708550c1325d49a0ad3af6557181e1e
3
+ metadata.gz: 5094211ab9d21742c4b0df1f711cd73b8f7ac9c275886fa4411a7ac8683fb287
4
+ data.tar.gz: 370b50282eb2a4d9ab9cfae046dce0856957e3ee672f7138df19f4e52e59b0f4
5
5
  SHA512:
6
- metadata.gz: d967c3cd4a784d1839cae80a2aa00efd06fe8f6a757ad372f4d0839f332c4c3e65d43d199dc8136fc5827791e543a82dfc2bb2ad7dade918647286b0ee153853
7
- data.tar.gz: d5a38d81451a488fde804af1d19f8dc8515b4d3b087d12b7eb305b528e8943d88e5e6e5255940c771a78b795d028b1a406d1cef0b68a006665228b6bfdb0383a
6
+ metadata.gz: 763997a408440c9194de3596088d6936d9c86a4ffdc67506058d82518580d4dcd25d314885fa592472dbc3796ff958ddbae957e9708456e8c0c138422ac726f7
7
+ data.tar.gz: ad013568c56d30105bdac1715fff11632e24ef91542ab8658e5f6fd0d710b5fc6ddd734210cf8e0e8927d579bd2441cdc55fcc6c387ec921acb8914b87ce192a
data/README.md CHANGED
@@ -4,6 +4,14 @@
4
4
  [![Build Status](https://badge.buildkite.com/446fd6049a9a5eeab50112aba117d3b7670ec085acb91f78dd.svg?branch=master)](https://buildkite.com/chef-oss/chef-omnibus-master-verify)
5
5
  [![AppVeyor Build Status](http://img.shields.io/appveyor/ci/chef/omnibus.svg?label=AppVeyor)][appveyor]
6
6
 
7
+ **Umbrella Project**: [Chef Foundation](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-foundation.md)
8
+
9
+ **Project State**: [Active](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md#active)
10
+
11
+ **Issues [Response Time Maximum](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md)**: 14 days
12
+
13
+ **Pull Request [Response Time Maximum](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md)**: 14 days
14
+
7
15
  Easily create full-stack installers for your project across a variety of platforms.
8
16
 
9
17
  Seth Chisamore and Christopher Maier of CHEF gave an introductory talk on Omnibus at ChefConf 2013, entitled **Eat the Whole Bowl: Building a Full-Stack Installer with Omnibus**:
@@ -91,7 +91,7 @@ module Omnibus
91
91
  if @options[:output_manifest]
92
92
  FileUtils.mkdir_p("pkg")
93
93
  File.open(::File.join("pkg", "version-manifest.json"), "w") do |f|
94
- f.write(FFI_Yajl::Encoder.encode(project.built_manifest.to_hash))
94
+ f.write(FFI_Yajl::Encoder.encode(project.built_manifest.to_hash, pretty: true))
95
95
  end
96
96
  end
97
97
  end
@@ -26,10 +26,10 @@ module Omnibus
26
26
  #
27
27
  # @example JSON
28
28
  # {
29
- # "ubuntu-10.04": [
30
- # "ubuntu-10.04",
31
- # "ubuntu-12.04",
32
- # "ubuntu-14.04"
29
+ # "ubuntu-10.04-x86_64": [
30
+ # "ubuntu-10.04-x86_64",
31
+ # "ubuntu-12.04-x86_64",
32
+ # "ubuntu-14.04-x86_64"
33
33
  # ]
34
34
  # }
35
35
  #
@@ -99,7 +99,7 @@ module Omnibus
99
99
  end
100
100
 
101
101
  klass.publish(pattern, options) do |package|
102
- say("Published '#{package.name}' for #{package.metadata[:platform]}-#{package.metadata[:platform_version]}", :green)
102
+ say("Published '#{package.name}' for #{package.metadata[:platform]}-#{package.metadata[:platform_version]}-#{package.metadata[:arch]}", :green)
103
103
  end
104
104
  end
105
105
  end
@@ -43,6 +43,8 @@ module Omnibus
43
43
  prettify_dmg
44
44
  compress_dmg
45
45
  set_dmg_icon
46
+ verify_dmg
47
+ remove_writable_dmg
46
48
  end
47
49
 
48
50
  #
@@ -143,7 +145,8 @@ module Omnibus
143
145
  -fs HFS+ \\
144
146
  -fsargs "-c c=64,a=16,e=16" \\
145
147
  -size 512000k \\
146
- "#{writable_dmg}"
148
+ "#{writable_dmg}" \\
149
+ -puppetstrings
147
150
  EOH
148
151
  end
149
152
 
@@ -159,6 +162,7 @@ module Omnibus
159
162
 
160
163
  cmd = shellout! <<-EOH.gsub(/^ {10}/, "")
161
164
  hdiutil attach \\
165
+ -puppetstrings \\
162
166
  -readwrite \\
163
167
  -noverify \\
164
168
  -noautoopen \\
@@ -254,13 +258,48 @@ module Omnibus
254
258
  shellout! <<-EOH.gsub(/^ {10}/, "")
255
259
  chmod -Rf go-w "/Volumes/#{volume_name}"
256
260
  sync
257
- hdiutil detach "#{@device}"
261
+ hdiutil unmount "#{@device}"
262
+ # Give some time to the system so unmount dmg
263
+ sleep 5
264
+ hdiutil detach "#{@device}" && \
258
265
  hdiutil convert \\
259
266
  "#{writable_dmg}" \\
260
267
  -format UDZO \\
261
268
  -imagekey \\
262
269
  zlib-level=9 \\
263
- -o "#{package_path}"
270
+ -o "#{package_path}" \\
271
+ -puppetstrings
272
+ EOH
273
+ end
274
+ end
275
+
276
+ #
277
+ # Verify checksum on created dmg.
278
+ #
279
+ # @return [void]
280
+ #
281
+ def verify_dmg
282
+ log.info(log_key) { "Verifying dmg" }
283
+
284
+ Dir.chdir(staging_dir) do
285
+ shellout! <<-EOH.gsub(/^ {10}/, "")
286
+ hdiutil verify \\
287
+ "#{package_path}" \\
288
+ -puppetstrings
289
+ EOH
290
+ end
291
+ end
292
+
293
+ #
294
+ # Remove writable dmg.
295
+ #
296
+ # @return [void]
297
+ #
298
+ def remove_writable_dmg
299
+ log.info(log_key) { "Removing writable dmg" }
300
+
301
+ Dir.chdir(staging_dir) do
302
+ shellout! <<-EOH.gsub(/^ {10}/, "")
264
303
  rm -rf "#{writable_dmg}"
265
304
  EOH
266
305
  end
@@ -56,13 +56,13 @@ module Omnibus
56
56
  #
57
57
  def all_files_under(source, options = {})
58
58
  excludes = Array(options[:exclude]).map do |exclude|
59
- [exclude, "#{exclude}/*"]
59
+ [exclude, "#{exclude}/**"]
60
60
  end.flatten
61
61
 
62
62
  source_files = glob(File.join(source, "**/*"))
63
63
  source_files = source_files.reject do |source_file|
64
64
  basename = relative_path_for(source_file, source)
65
- excludes.any? { |exclude| File.fnmatch?(exclude, basename, File::FNM_DOTMATCH) }
65
+ excludes.any? { |exclude| File.fnmatch?(exclude, basename, File::FNM_DOTMATCH | File::FNM_PATHNAME) }
66
66
  end
67
67
  end
68
68
 
@@ -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
  #
@@ -75,33 +75,35 @@ module Omnibus
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` and `12.04`
79
- build_platform, build_platform_version = build_platform.rpartition("-") - %w{ - }
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
+ "Could not locate a package for build platform #{build_platform}-#{build_platform_version}-#{build_architecture}. " \
90
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.rpartition("-") - %w{ - }
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 and platform version in the metadata
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)
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Omnibus
18
- VERSION = "6.0.30".freeze
18
+ VERSION = "6.1.4".freeze
19
19
  end
@@ -22,8 +22,8 @@ Gem::Specification.new do |gem|
22
22
  gem.require_paths = ["lib"]
23
23
 
24
24
  gem.add_dependency "aws-sdk-s3", "~> 1"
25
- gem.add_dependency "chef-sugar", ">= 3.3"
26
- gem.add_dependency "cleanroom", "~> 1.0"
25
+ gem.add_dependency "chef-sugar-ng", ">= 3.3"
26
+ gem.add_dependency "chef-cleanroom", "~> 1.0"
27
27
  gem.add_dependency "ffi-yajl", "~> 2.2"
28
28
  gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
29
29
  gem.add_dependency "ohai", ">= 13", "< 16"
@@ -56,6 +56,14 @@ module Omnibus
56
56
  FileUtils.touch(File.join(source, ".dot_folder", "file_f"))
57
57
 
58
58
  FileUtils.touch(File.join(source, ".file_g"))
59
+
60
+ FileUtils.mkdir_p(File.join(source, "nested", "deep", "folder"))
61
+ FileUtils.touch(File.join(source, "nested", "deep", "folder", "file_h"))
62
+ FileUtils.touch(File.join(source, "nested", "deep", "folder", "file_i"))
63
+
64
+ FileUtils.mkdir_p(File.join(source, "nested", "deep", "deep", "folder"))
65
+ FileUtils.touch(File.join(source, "nested", "deep", "deep", "folder", "file_j"))
66
+ FileUtils.touch(File.join(source, "nested", "deep", "deep", "folder", "file_k"))
59
67
  source
60
68
  end
61
69
 
@@ -233,6 +241,40 @@ module Omnibus
233
241
  expect("#{destination}/.file_g").to be_a_file
234
242
  end
235
243
 
244
+ it "does not copy files and folders that match the wildcard pattern" do
245
+ described_class.sync(source, destination, exclude: "nested/*/folder")
246
+
247
+ expect("#{destination}/file_a").to be_a_file
248
+ expect("#{destination}/file_b").to be_a_file
249
+ expect("#{destination}/file_c").to be_a_file
250
+ expect("#{destination}/folder/file_d").to be_a_file
251
+ expect("#{destination}/folder/file_e").to be_a_file
252
+ expect("#{destination}/.dot_folder").to be_a_directory
253
+ expect("#{destination}/.dot_folder/file_f").to be_a_file
254
+ expect("#{destination}/.file_g").to be_a_file
255
+ expect("#{destination}/nested/deep/folder/file_h").to_not be_a_file
256
+ expect("#{destination}/nested/deep/folder/file_i").to_not be_a_file
257
+ expect("#{destination}/nested/deep/deep/folder/file_j").to be_a_file
258
+ expect("#{destination}/nested/deep/deep/folder/file_k").to be_a_file
259
+ end
260
+
261
+ it "does not copy files and folders that match the super wildcard pattern" do
262
+ described_class.sync(source, destination, exclude: "nested/**/folder")
263
+
264
+ expect("#{destination}/file_a").to be_a_file
265
+ expect("#{destination}/file_b").to be_a_file
266
+ expect("#{destination}/file_c").to be_a_file
267
+ expect("#{destination}/folder/file_d").to be_a_file
268
+ expect("#{destination}/folder/file_e").to be_a_file
269
+ expect("#{destination}/.dot_folder").to be_a_directory
270
+ expect("#{destination}/.dot_folder/file_f").to be_a_file
271
+ expect("#{destination}/.file_g").to be_a_file
272
+ expect("#{destination}/nested/deep/folder/file_h").to_not be_a_file
273
+ expect("#{destination}/nested/deep/folder/file_i").to_not be_a_file
274
+ expect("#{destination}/nested/deep/deep/folder/file_j").to_not be_a_file
275
+ expect("#{destination}/nested/deep/deep/folder/file_k").to_not be_a_file
276
+ end
277
+
236
278
  it "removes existing files and folders in destination" do
237
279
  FileUtils.mkdir_p("#{destination}/existing_folder")
238
280
  FileUtils.touch("#{destination}/existing_file")
@@ -90,7 +90,8 @@ module Omnibus
90
90
  -fs HFS+ \\
91
91
  -fsargs "-c c=64,a=16,e=16" \\
92
92
  -size 512000k \\
93
- "#{staging_dir}/project-writable.dmg"
93
+ "#{staging_dir}/project-writable.dmg" \\
94
+ -puppetstrings
94
95
  EOH
95
96
 
96
97
  subject.create_writable_dmg
@@ -114,6 +115,7 @@ module Omnibus
114
115
  expect(subject).to receive(:shellout!)
115
116
  .with <<-EOH.gsub(/^ {12}/, "")
116
117
  hdiutil attach \\
118
+ -puppetstrings \\
117
119
  -readwrite \\
118
120
  -noverify \\
119
121
  -noautoopen \\
@@ -215,20 +217,57 @@ module Omnibus
215
217
  .with <<-EOH.gsub(/^ {12}/, "")
216
218
  chmod -Rf go-w "/Volumes/Project One"
217
219
  sync
218
- hdiutil detach "#{device}"
220
+ hdiutil unmount "#{device}"
221
+ # Give some time to the system so unmount dmg
222
+ sleep 5
223
+ hdiutil detach "#{device}" &&\
219
224
  hdiutil convert \\
220
225
  "#{staging_dir}/project-writable.dmg" \\
221
226
  -format UDZO \\
222
227
  -imagekey \\
223
228
  zlib-level=9 \\
224
- -o "#{package_dir}/project-1.2.3-2.dmg"
225
- rm -rf "#{staging_dir}/project-writable.dmg"
229
+ -o "#{package_dir}/project-1.2.3-2.dmg" \\
230
+ -puppetstrings
226
231
  EOH
227
232
 
228
233
  subject.compress_dmg
229
234
  end
230
235
  end
231
236
 
237
+ describe "#verify_dmg" do
238
+ it "logs a message" do
239
+ output = capture_logging { subject.verify_dmg }
240
+ expect(output).to include("Verifying dmg")
241
+ end
242
+
243
+ it "runs the command" do
244
+ expect(subject).to receive(:shellout!)
245
+ .with <<-EOH.gsub(/^ {12}/, "")
246
+ hdiutil verify \\
247
+ "#{package_dir}/project-1.2.3-2.dmg" \\
248
+ -puppetstrings
249
+ EOH
250
+
251
+ subject.verify_dmg
252
+ end
253
+ end
254
+
255
+ describe "#remove_writable_dmg" do
256
+ it "logs a message" do
257
+ output = capture_logging { subject.remove_writable_dmg }
258
+ expect(output).to include("Removing writable dmg")
259
+ end
260
+
261
+ it "runs the command" do
262
+ expect(subject).to receive(:shellout!)
263
+ .with <<-EOH.gsub(/^ {12}/, "")
264
+ rm -rf "#{staging_dir}/project-writable.dmg"
265
+ EOH
266
+
267
+ subject.remove_writable_dmg
268
+ end
269
+ end
270
+
232
271
  describe "#set_dmg_icon" do
233
272
  it "logs a message" do
234
273
  output = capture_logging { subject.set_dmg_icon }
@@ -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
  }
@@ -155,9 +155,9 @@ module Omnibus
155
155
  let(:options) do
156
156
  {
157
157
  platform_mappings: {
158
- "ubuntu-10.04" => [
159
- "ubuntu-12.04",
160
- "ubuntu-14.04",
158
+ "ubuntu-10.04-x86_64" => [
159
+ "ubuntu-12.04-x86_64",
160
+ "ubuntu-14.04-x86_64",
161
161
  ],
162
162
  },
163
163
  }
@@ -165,7 +165,7 @@ module Omnibus
165
165
 
166
166
  it "prints a warning" do
167
167
  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")
168
+ 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
169
  end
170
170
  end
171
171
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.30
4
+ version: 6.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-13 00:00:00.000000000 Z
11
+ date: 2019-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: chef-sugar
28
+ name: chef-sugar-ng
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: cleanroom
42
+ name: chef-cleanroom
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"