omnibus 5.4.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -3
  3. data/CHANGELOG.md +21 -0
  4. data/Gemfile +8 -5
  5. data/README.md +3 -1
  6. data/Rakefile +20 -13
  7. data/appveyor.yml +4 -3
  8. data/bin/omnibus +3 -3
  9. data/features/commands/manifest.feature +19 -5
  10. data/features/step_definitions/generator_steps.rb +5 -6
  11. data/features/support/env.rb +4 -4
  12. data/lib/omnibus/build_version.rb +14 -14
  13. data/lib/omnibus/build_version_dsl.rb +3 -3
  14. data/lib/omnibus/builder.rb +50 -61
  15. data/lib/omnibus/changelog.rb +2 -2
  16. data/lib/omnibus/changelog_printer.rb +4 -4
  17. data/lib/omnibus/cleaner.rb +4 -4
  18. data/lib/omnibus/cli/base.rb +15 -15
  19. data/lib/omnibus/cli/cache.rb +13 -13
  20. data/lib/omnibus/cli/changelog.rb +8 -9
  21. data/lib/omnibus/cli/publish.rb +12 -13
  22. data/lib/omnibus/cli.rb +26 -27
  23. data/lib/omnibus/compressor.rb +6 -6
  24. data/lib/omnibus/compressors/base.rb +7 -2
  25. data/lib/omnibus/compressors/dmg.rb +12 -12
  26. data/lib/omnibus/compressors/null.rb +1 -1
  27. data/lib/omnibus/compressors/tgz.rb +8 -8
  28. data/lib/omnibus/config.rb +37 -26
  29. data/lib/omnibus/core_extensions/open_uri.rb +3 -3
  30. data/lib/omnibus/core_extensions.rb +1 -1
  31. data/lib/omnibus/digestable.rb +5 -4
  32. data/lib/omnibus/download_helpers.rb +7 -6
  33. data/lib/omnibus/exceptions.rb +29 -13
  34. data/lib/omnibus/fetcher.rb +0 -1
  35. data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
  36. data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
  37. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  38. data/lib/omnibus/file_syncer.rb +3 -3
  39. data/lib/omnibus/generator.rb +60 -47
  40. data/lib/omnibus/git_cache.rb +33 -22
  41. data/lib/omnibus/git_repository.rb +5 -5
  42. data/lib/omnibus/health_check.rb +122 -119
  43. data/lib/omnibus/instrumentation.rb +1 -1
  44. data/lib/omnibus/licensing.rb +348 -60
  45. data/lib/omnibus/logger.rb +12 -9
  46. data/lib/omnibus/logging.rb +1 -1
  47. data/lib/omnibus/manifest.rb +4 -4
  48. data/lib/omnibus/manifest_diff.rb +6 -7
  49. data/lib/omnibus/manifest_entry.rb +1 -1
  50. data/lib/omnibus/metadata.rb +36 -36
  51. data/lib/omnibus/ohai.rb +6 -7
  52. data/lib/omnibus/package.rb +1 -1
  53. data/lib/omnibus/packager.rb +37 -28
  54. data/lib/omnibus/packagers/appx.rb +86 -0
  55. data/lib/omnibus/packagers/base.rb +21 -18
  56. data/lib/omnibus/packagers/bff.rb +22 -24
  57. data/lib/omnibus/packagers/deb.rb +20 -20
  58. data/lib/omnibus/packagers/ips.rb +18 -17
  59. data/lib/omnibus/packagers/makeself.rb +7 -7
  60. data/lib/omnibus/packagers/msi.rb +38 -193
  61. data/lib/omnibus/packagers/pkg.rb +16 -16
  62. data/lib/omnibus/packagers/rpm.rb +53 -54
  63. data/lib/omnibus/packagers/solaris.rb +14 -14
  64. data/lib/omnibus/packagers/windows_base.rb +192 -0
  65. data/lib/omnibus/project.rb +45 -43
  66. data/lib/omnibus/publisher.rb +3 -3
  67. data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
  68. data/lib/omnibus/publishers/s3_publisher.rb +7 -7
  69. data/lib/omnibus/reports.rb +10 -10
  70. data/lib/omnibus/s3_cache.rb +7 -7
  71. data/lib/omnibus/s3_helpers.rb +8 -7
  72. data/lib/omnibus/semantic_version.rb +1 -1
  73. data/lib/omnibus/software.rb +131 -81
  74. data/lib/omnibus/sugarable.rb +10 -10
  75. data/lib/omnibus/templating.rb +5 -5
  76. data/lib/omnibus/thread_pool.rb +1 -1
  77. data/lib/omnibus/util.rb +5 -5
  78. data/lib/omnibus/version.rb +1 -1
  79. data/lib/omnibus.rb +65 -65
  80. data/omnibus.gemspec +34 -32
  81. data/resources/appx/AppxManifest.xml.erb +18 -0
  82. data/resources/appx/assets/clear.png +0 -0
  83. data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
  84. data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
  85. data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
  86. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
  87. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
  88. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
  89. data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
  90. data/spec/functional/builder_spec.rb +149 -150
  91. data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
  92. data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
  93. data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
  94. data/spec/functional/file_syncer_spec.rb +74 -74
  95. data/spec/functional/licensing_spec.rb +344 -35
  96. data/spec/functional/templating_spec.rb +17 -17
  97. data/spec/spec_helper.rb +20 -20
  98. data/spec/support/examples.rb +21 -15
  99. data/spec/support/file_helpers.rb +1 -1
  100. data/spec/support/git_helpers.rb +37 -37
  101. data/spec/support/matchers.rb +3 -3
  102. data/spec/support/ohai_helpers.rb +4 -4
  103. data/spec/support/path_helpers.rb +2 -2
  104. data/spec/support/shell_helpers.rb +2 -2
  105. data/spec/unit/build_version_dsl_spec.rb +5 -5
  106. data/spec/unit/build_version_spec.rb +63 -63
  107. data/spec/unit/builder_spec.rb +86 -70
  108. data/spec/unit/changelog_spec.rb +4 -4
  109. data/spec/unit/changelogprinter_spec.rb +130 -0
  110. data/spec/unit/cleanroom_spec.rb +11 -11
  111. data/spec/unit/compressor_spec.rb +16 -16
  112. data/spec/unit/compressors/base_spec.rb +6 -6
  113. data/spec/unit/compressors/dmg_spec.rb +76 -76
  114. data/spec/unit/compressors/null_spec.rb +4 -4
  115. data/spec/unit/compressors/tgz_spec.rb +20 -20
  116. data/spec/unit/config_spec.rb +44 -43
  117. data/spec/unit/digestable_spec.rb +13 -13
  118. data/spec/unit/fetcher_spec.rb +11 -12
  119. data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
  120. data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
  121. data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
  122. data/spec/unit/generator_spec.rb +38 -38
  123. data/spec/unit/git_cache_spec.rb +56 -54
  124. data/spec/unit/git_repository_spec.rb +2 -2
  125. data/spec/unit/health_check_spec.rb +40 -40
  126. data/spec/unit/library_spec.rb +35 -35
  127. data/spec/unit/manifest_diff_spec.rb +10 -11
  128. data/spec/unit/manifest_spec.rb +17 -17
  129. data/spec/unit/metadata_spec.rb +152 -152
  130. data/spec/unit/ohai_spec.rb +5 -5
  131. data/spec/unit/omnibus_spec.rb +31 -31
  132. data/spec/unit/package_spec.rb +20 -20
  133. data/spec/unit/packager_spec.rb +48 -42
  134. data/spec/unit/packagers/appx_spec.rb +165 -0
  135. data/spec/unit/packagers/base_spec.rb +34 -34
  136. data/spec/unit/packagers/bff_spec.rb +60 -60
  137. data/spec/unit/packagers/deb_spec.rb +71 -71
  138. data/spec/unit/packagers/ips_spec.rb +45 -45
  139. data/spec/unit/packagers/makeself_spec.rb +22 -22
  140. data/spec/unit/packagers/msi_spec.rb +141 -147
  141. data/spec/unit/packagers/pkg_spec.rb +59 -60
  142. data/spec/unit/packagers/rpm_spec.rb +125 -126
  143. data/spec/unit/packagers/solaris_spec.rb +52 -52
  144. data/spec/unit/project_spec.rb +137 -135
  145. data/spec/unit/publisher_spec.rb +70 -70
  146. data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
  147. data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
  148. data/spec/unit/s3_cacher_spec.rb +34 -34
  149. data/spec/unit/s3_helpers_spec.rb +6 -6
  150. data/spec/unit/semantic_version_spec.rb +2 -2
  151. data/spec/unit/software_spec.rb +346 -384
  152. data/spec/unit/sugarable_spec.rb +10 -10
  153. data/spec/unit/util_spec.rb +60 -60
  154. metadata +54 -6
  155. data/.rubocop.yml +0 -48
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  module Omnibus
4
4
  # Used in the tests
@@ -7,26 +7,26 @@ module Omnibus
7
7
  describe Publisher do
8
8
  it { should be_a_kind_of(Logging) }
9
9
 
10
- describe '.publish' do
10
+ describe ".publish" do
11
11
  let(:publisher) { double(described_class) }
12
12
 
13
13
  before { allow(described_class).to receive(:new).and_return(publisher) }
14
14
 
15
- it 'creates a new instance of the class' do
15
+ it "creates a new instance of the class" do
16
16
  expect(described_class).to receive(:new).once
17
17
  expect(publisher).to receive(:publish).once
18
- described_class.publish('/path/to/*.deb')
18
+ described_class.publish("/path/to/*.deb")
19
19
  end
20
20
  end
21
21
 
22
- let(:pattern) { '/path/to/files/*.deb' }
22
+ let(:pattern) { "/path/to/files/*.deb" }
23
23
  let(:options) { { some_option: true } }
24
24
 
25
25
  subject { described_class.new(pattern, options) }
26
26
 
27
27
  describe '#packages' do
28
- let(:a) { '/path/to/files/a.deb' }
29
- let(:b) { '/path/to/files/b.deb' }
28
+ let(:a) { "/path/to/files/a.deb" }
29
+ let(:b) { "/path/to/files/b.deb" }
30
30
  let(:glob) { [a, b] }
31
31
 
32
32
  before do
@@ -35,104 +35,104 @@ module Omnibus
35
35
  .and_return(glob)
36
36
  end
37
37
 
38
- it 'returns an array' do
38
+ it "returns an array" do
39
39
  expect(subject.packages).to be_an(Array)
40
40
  end
41
41
 
42
- it 'returns an array of Package objects' do
42
+ it "returns an array of Package objects" do
43
43
  expect(subject.packages.first).to be_a(Package)
44
44
  end
45
45
 
46
- context 'a platform mappings matrix is provided' do
46
+ context "a platform mappings matrix is provided" do
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" => [
51
+ "ubuntu-12.04",
52
+ "ubuntu-14.04",
53
53
  ],
54
54
  },
55
55
  }
56
56
  end
57
57
 
58
58
  let(:package) do
59
- Package.new('/path/to/files/chef.deb')
59
+ Package.new("/path/to/files/chef.deb")
60
60
  end
61
61
 
62
62
  let(:metadata) do
63
63
  Metadata.new(package,
64
- name: 'chef',
65
- friendly_name: 'Chef',
66
- homepage: 'https://www.getchef.com',
67
- version: '11.0.6',
64
+ name: "chef",
65
+ friendly_name: "Chef",
66
+ homepage: "https://www.getchef.com",
67
+ version: "11.0.6",
68
68
  iteration: 1,
69
- basename: 'chef.deb',
70
- license: 'Apache-2.0',
71
- platform: 'ubuntu',
72
- platform_version: '12.04',
73
- arch: 'x86_64',
74
- sha1: 'SHA1',
75
- md5: 'ABCDEF123456',
69
+ basename: "chef.deb",
70
+ license: "Apache-2.0",
71
+ platform: "ubuntu",
72
+ platform_version: "12.04",
73
+ arch: "x86_64",
74
+ sha1: "SHA1",
75
+ md5: "ABCDEF123456",
76
76
  version_manifest: {
77
77
  manifest_format: 1,
78
- build_version: '11.0.6',
79
- build_git_revision: '2e763ac957b308ba95cef256c2491a5a55a163cc',
78
+ build_version: "11.0.6",
79
+ build_git_revision: "2e763ac957b308ba95cef256c2491a5a55a163cc",
80
80
  software: {
81
81
  zlib: {
82
82
  locked_source: {
83
- md5: '44d667c142d7cda120332623eab69f40',
84
- url: 'http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz',
83
+ md5: "44d667c142d7cda120332623eab69f40",
84
+ url: "http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz",
85
85
  },
86
- locked_version: '1.2.8',
87
- source_type: 'url',
88
- described_version: '1.2.8',
89
- license: 'Zlib',
86
+ locked_version: "1.2.8",
87
+ source_type: "url",
88
+ described_version: "1.2.8",
89
+ license: "Zlib",
90
90
  },
91
91
  openssl: {
92
92
  locked_source: {
93
- md5: '562986f6937aabc7c11a6d376d8a0d26',
94
- extract: 'lax_tar',
95
- url: 'http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz',
93
+ md5: "562986f6937aabc7c11a6d376d8a0d26",
94
+ extract: "lax_tar",
95
+ url: "http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz",
96
96
  },
97
- locked_version: '1.0.1s',
98
- source_type: 'url',
99
- described_version: '1.0.1s',
100
- license: 'OpenSSL',
97
+ locked_version: "1.0.1s",
98
+ source_type: "url",
99
+ described_version: "1.0.1s",
100
+ license: "OpenSSL",
101
101
  },
102
102
  ruby: {
103
103
  locked_source: {
104
- md5: '091b62f0a9796a3c55de2a228a0e6ef3',
105
- url: 'https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.8.tar.gz',
104
+ md5: "091b62f0a9796a3c55de2a228a0e6ef3",
105
+ url: "https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.8.tar.gz",
106
106
  },
107
- locked_version: '2.1.8',
108
- source_type: 'url',
109
- described_version: '2.1.8',
110
- license: 'BSD-2-Clause',
107
+ locked_version: "2.1.8",
108
+ source_type: "url",
109
+ described_version: "2.1.8",
110
+ license: "BSD-2-Clause",
111
111
  },
112
112
  ohai: {
113
113
  locked_source: {
114
- git: 'https://github.com/opscode/ohai.git'
114
+ git: "https://github.com/opscode/ohai.git",
115
115
  },
116
- locked_version: 'fec0959aa5da5ce7ba0e07740dbc08546a8f53f0',
117
- source_type: 'git',
118
- described_version: 'master',
119
- license: 'Apache-2.0',
116
+ locked_version: "fec0959aa5da5ce7ba0e07740dbc08546a8f53f0",
117
+ source_type: "git",
118
+ described_version: "master",
119
+ license: "Apache-2.0",
120
120
  },
121
121
  chef: {
122
122
  locked_source: {
123
- path: '/home/jenkins/workspace/chef-build/architecture/x86_64/platform/ubuntu-10.04/project/chef/role/builder/omnibus/files/../..',
123
+ path: "/home/jenkins/workspace/chef-build/architecture/x86_64/platform/ubuntu-10.04/project/chef/role/builder/omnibus/files/../..",
124
124
  options: {
125
125
  exclude: [
126
- 'omnibus/vendor',
126
+ "omnibus/vendor",
127
127
  ],
128
128
  },
129
129
  },
130
- locked_version: 'local_source',
131
- source_type: 'path',
132
- described_version: 'local_source',
133
- license: 'Apache-2.0',
130
+ locked_version: "local_source",
131
+ source_type: "path",
132
+ described_version: "local_source",
133
+ license: "Apache-2.0",
134
134
  },
135
- }
135
+ },
136
136
  }
137
137
  )
138
138
  end
@@ -142,51 +142,51 @@ module Omnibus
142
142
  allow(FileSyncer).to receive_message_chain(:glob, :map).and_return([package])
143
143
  end
144
144
 
145
- it 'creates a package for each publish platform' do
145
+ it "creates a package for each publish platform" do
146
146
  expect(subject.packages.size).to eq(2)
147
147
  expect(
148
148
  subject.packages.map do |p|
149
149
  p.metadata[:platform_version]
150
150
  end
151
- ).to include('12.04', '14.04')
151
+ ).to include("12.04", "14.04")
152
152
  end
153
153
 
154
- context 'the build platform does not exist' do
154
+ context "the build platform does not exist" do
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" => [
159
+ "ubuntu-12.04",
160
+ "ubuntu-14.04",
161
161
  ],
162
162
  },
163
163
  }
164
164
  end
165
165
 
166
- it 'prints a warning' do
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. Publishing will be skipped for: ubuntu-12.04, ubuntu-14.04")
169
169
  end
170
170
  end
171
171
  end
172
172
 
173
- context 'there are no packages to publish' do
173
+ context "there are no packages to publish" do
174
174
  before do
175
175
  allow(FileSyncer).to receive(:glob)
176
176
  .with(pattern)
177
177
  .and_return([])
178
178
  end
179
179
 
180
- it 'prints a warning' do
180
+ it "prints a warning" do
181
181
  output = capture_logging { subject.packages }
182
- expect(output).to include('No packages found, skipping publish')
182
+ expect(output).to include("No packages found, skipping publish")
183
183
  end
184
184
  end
185
185
 
186
186
  end
187
187
 
188
188
  describe '#publish' do
189
- it 'is an abstract method' do
189
+ it "is an abstract method" do
190
190
  expect { subject.publish }.to raise_error(NotImplementedError)
191
191
  end
192
192
  end
@@ -1,103 +1,103 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  module Omnibus
4
4
  describe ArtifactoryPublisher do
5
- let(:path) { '/path/to/files/*.deb' }
6
- let(:repository) { 'REPO' }
5
+ let(:path) { "/path/to/files/*.deb" }
6
+ let(:repository) { "REPO" }
7
7
 
8
8
  let(:package) do
9
9
  double(Package,
10
- path: '/path/to/files/chef.deb',
11
- name: 'chef.deb',
12
- content: 'BINARY',
13
- validate!: true,
10
+ path: "/path/to/files/chef.deb",
11
+ name: "chef.deb",
12
+ content: "BINARY",
13
+ validate!: true
14
14
  )
15
15
  end
16
16
 
17
17
  let(:metadata) do
18
18
  Metadata.new(package,
19
- name: 'chef',
20
- friendly_name: 'Chef',
21
- homepage: 'https://www.getchef.com',
22
- version: '11.0.6',
19
+ name: "chef",
20
+ friendly_name: "Chef",
21
+ homepage: "https://www.getchef.com",
22
+ version: "11.0.6",
23
23
  iteration: 1,
24
- license: 'Apache-2.0',
25
- basename: 'chef.deb',
26
- platform: 'ubuntu',
27
- platform_version: '14.04',
28
- arch: 'x86_64',
29
- sha1: 'SHA1',
30
- sha256: 'SHA256',
31
- sha512: 'SHA512',
32
- md5: 'ABCDEF123456',
24
+ license: "Apache-2.0",
25
+ basename: "chef.deb",
26
+ platform: "ubuntu",
27
+ platform_version: "14.04",
28
+ arch: "x86_64",
29
+ sha1: "SHA1",
30
+ sha256: "SHA256",
31
+ sha512: "SHA512",
32
+ md5: "ABCDEF123456",
33
33
  version_manifest: {
34
34
  manifest_format: 1,
35
- build_version: '11.0.6',
36
- build_git_revision: '2e763ac957b308ba95cef256c2491a5a55a163cc',
35
+ build_version: "11.0.6",
36
+ build_git_revision: "2e763ac957b308ba95cef256c2491a5a55a163cc",
37
37
  software: {
38
38
  zlib: {
39
39
  locked_source: {
40
- md5: '44d667c142d7cda120332623eab69f40',
41
- url: 'http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz',
40
+ md5: "44d667c142d7cda120332623eab69f40",
41
+ url: "http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz",
42
42
  },
43
- locked_version: '1.2.8',
44
- source_type: 'url',
45
- described_version: '1.2.8',
46
- license: 'Zlib',
43
+ locked_version: "1.2.8",
44
+ source_type: "url",
45
+ described_version: "1.2.8",
46
+ license: "Zlib",
47
47
  },
48
48
  openssl: {
49
49
  locked_source: {
50
- md5: '562986f6937aabc7c11a6d376d8a0d26',
51
- extract: 'lax_tar',
52
- url: 'http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz',
50
+ md5: "562986f6937aabc7c11a6d376d8a0d26",
51
+ extract: "lax_tar",
52
+ url: "http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz",
53
53
  },
54
- locked_version: '1.0.1s',
55
- source_type: 'url',
56
- described_version: '1.0.1s',
57
- license: 'OpenSSL',
54
+ locked_version: "1.0.1s",
55
+ source_type: "url",
56
+ described_version: "1.0.1s",
57
+ license: "OpenSSL",
58
58
  },
59
59
  ruby: {
60
60
  locked_source: {
61
- md5: '091b62f0a9796a3c55de2a228a0e6ef3',
62
- url: 'https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.8.tar.gz',
61
+ md5: "091b62f0a9796a3c55de2a228a0e6ef3",
62
+ url: "https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.8.tar.gz",
63
63
  },
64
- locked_version: '2.1.8',
65
- source_type: 'url',
66
- described_version: '2.1.8',
67
- license: 'BSD-2-Clause',
64
+ locked_version: "2.1.8",
65
+ source_type: "url",
66
+ described_version: "2.1.8",
67
+ license: "BSD-2-Clause",
68
68
  },
69
69
  ohai: {
70
70
  locked_source: {
71
- git: 'https://github.com/opscode/ohai.git'
71
+ git: "https://github.com/opscode/ohai.git",
72
72
  },
73
- locked_version: 'fec0959aa5da5ce7ba0e07740dbc08546a8f53f0',
74
- source_type: 'git',
75
- described_version: 'master',
76
- license: 'Apache-2.0',
73
+ locked_version: "fec0959aa5da5ce7ba0e07740dbc08546a8f53f0",
74
+ source_type: "git",
75
+ described_version: "master",
76
+ license: "Apache-2.0",
77
77
  },
78
78
  chef: {
79
79
  locked_source: {
80
- path: '/home/jenkins/workspace/chef-build/architecture/x86_64/platform/ubuntu-10.04/project/chef/role/builder/omnibus/files/../..',
80
+ path: "/home/jenkins/workspace/chef-build/architecture/x86_64/platform/ubuntu-10.04/project/chef/role/builder/omnibus/files/../..",
81
81
  options: {
82
82
  exclude: [
83
- 'omnibus/vendor',
83
+ "omnibus/vendor",
84
84
  ],
85
85
  },
86
86
  },
87
- locked_version: 'local_source',
88
- source_type: 'path',
89
- described_version: 'local_source',
90
- license: 'Apache-2.0',
87
+ locked_version: "local_source",
88
+ source_type: "path",
89
+ described_version: "local_source",
90
+ license: "Apache-2.0",
91
91
  },
92
- }
92
+ },
93
93
  }
94
94
  )
95
95
  end
96
96
 
97
97
  let(:packages) { [package] }
98
- let(:client) { double('Artifactory::Client') }
99
- let(:artifact) { double('Artifactory::Resource::Artifact', upload: nil) }
100
- let(:build) { double('Artifactory::Resource::Build') }
98
+ let(:client) { double("Artifactory::Client") }
99
+ let(:artifact) { double("Artifactory::Resource::Artifact", upload: nil) }
100
+ let(:build) { double("Artifactory::Resource::Build") }
101
101
 
102
102
  let(:package_properties) do
103
103
  {
@@ -116,7 +116,7 @@ module Omnibus
116
116
  end
117
117
  let(:metadata_json_properites) do
118
118
  # we don't attache checksum properties to the *.metadata.json
119
- package_properties.delete_if { |k,v| k =~ /md5|sha/ }
119
+ package_properties.delete_if { |k, v| k =~ /md5|sha/ }
120
120
  end
121
121
  let(:build_values) do
122
122
  {
@@ -125,7 +125,7 @@ module Omnibus
125
125
  }
126
126
  end
127
127
 
128
- let(:options) { {repository: repository} }
128
+ let(:options) { { repository: repository } }
129
129
 
130
130
  before do
131
131
  allow(subject).to receive(:client).and_return(client)
@@ -140,20 +140,20 @@ module Omnibus
140
140
  describe '#publish' do
141
141
  before do
142
142
  allow(subject).to receive(:packages).and_return(packages)
143
- Config.artifactory_base_path('com/getchef')
143
+ Config.artifactory_base_path("com/getchef")
144
144
  Config.publish_retries(1)
145
145
  end
146
146
 
147
- it 'validates the package' do
147
+ it "validates the package" do
148
148
  expect(package).to receive(:validate!).once
149
149
  subject.publish
150
150
  end
151
151
 
152
- it 'uploads the package' do
152
+ it "uploads the package" do
153
153
  expect(artifact).to receive(:upload).with(
154
154
  repository,
155
- 'com/getchef/chef/11.0.6/ubuntu/14.04/chef.deb',
156
- hash_including(package_properties),
155
+ "com/getchef/chef/11.0.6/ubuntu/14.04/chef.deb",
156
+ hash_including(package_properties)
157
157
  ).once
158
158
 
159
159
  subject.publish
@@ -162,28 +162,28 @@ module Omnibus
162
162
  it "uploads the package's associated *.metadata.json" do
163
163
  expect(artifact).to receive(:upload).with(
164
164
  repository,
165
- 'com/getchef/chef/11.0.6/ubuntu/14.04/chef.deb.metadata.json',
166
- hash_including(metadata_json_properites),
165
+ "com/getchef/chef/11.0.6/ubuntu/14.04/chef.deb.metadata.json",
166
+ hash_including(metadata_json_properites)
167
167
  ).once
168
168
 
169
169
  subject.publish
170
170
  end
171
171
 
172
- it 'it creates a build record for all packages' do
172
+ it "it creates a build record for all packages" do
173
173
  expect(build).to receive(:save).once
174
174
  subject.publish
175
175
  end
176
176
 
177
- context 'when no packages exist' do
177
+ context "when no packages exist" do
178
178
  let(:packages) { [] }
179
179
 
180
- it 'does nothing' do
180
+ it "does nothing" do
181
181
  expect(artifact).to_not receive(:upload)
182
182
  expect(build).to_not receive(:save)
183
183
  end
184
184
  end
185
185
 
186
- context 'when upload fails' do
186
+ context "when upload fails" do
187
187
  before do
188
188
  Config.publish_retries(3)
189
189
 
@@ -192,39 +192,39 @@ module Omnibus
192
192
  @times = 0
193
193
  allow(artifact).to receive(:upload) do
194
194
  @times += 1;
195
- raise Artifactory::Error::HTTPError.new('status' => '409', 'message' => 'CONFLICT') unless @times > 1
195
+ raise Artifactory::Error::HTTPError.new("status" => "409", "message" => "CONFLICT") unless @times > 1
196
196
  end
197
197
  end
198
198
 
199
- it 'retries the upload ' do
199
+ it "retries the upload " do
200
200
  output = capture_logging { subject.publish }
201
- expect(output).to include('Retrying failed publish')
201
+ expect(output).to include("Retrying failed publish")
202
202
  end
203
203
 
204
204
  end
205
205
 
206
- context 'when a block is given' do
207
- it 'yields the package to the block' do
206
+ context "when a block is given" do
207
+ it "yields the package to the block" do
208
208
  block = ->(package) { package.do_something! }
209
209
  expect(package).to receive(:do_something!).once
210
210
  subject.publish(&block)
211
211
  end
212
212
  end
213
213
 
214
- context 'when the :build_record option is false' do
214
+ context "when the :build_record option is false" do
215
215
  subject { described_class.new(path, repository: repository, build_record: false) }
216
216
 
217
- it 'does not create a build record at the end of publishing' do
217
+ it "does not create a build record at the end of publishing" do
218
218
  expect(build).to_not receive(:save)
219
219
  subject.publish
220
220
  end
221
221
  end
222
222
 
223
- context 'additional properties are provided' do
223
+ context "additional properties are provided" do
224
224
  let(:delivery_props) do
225
225
  {
226
- 'delivery.change' => '4dbf38de-3e82-439f-8090-c5f3e11aeba6',
227
- 'delivery.sha' => 'ec1cb62616350176fc6fd9b1dc4ad3153caa0791',
226
+ "delivery.change" => "4dbf38de-3e82-439f-8090-c5f3e11aeba6",
227
+ "delivery.sha" => "ec1cb62616350176fc6fd9b1dc4ad3153caa0791",
228
228
  }
229
229
  end
230
230
  let(:options) do
@@ -234,11 +234,11 @@ module Omnibus
234
234
  }
235
235
  end
236
236
 
237
- it 'uploads the package with the provided properties' do
237
+ it "uploads the package with the provided properties" do
238
238
  expect(artifact).to receive(:upload).with(
239
239
  repository,
240
- 'com/getchef/chef/11.0.6/ubuntu/14.04/chef.deb',
241
- hash_including(package_properties.merge(delivery_props)),
240
+ "com/getchef/chef/11.0.6/ubuntu/14.04/chef.deb",
241
+ hash_including(package_properties.merge(delivery_props))
242
242
  ).once
243
243
 
244
244
  subject.publish
@@ -247,11 +247,11 @@ module Omnibus
247
247
  end
248
248
 
249
249
  describe '#metadata_properties_for' do
250
- it 'returns the transformed package metadata values' do
250
+ it "returns the transformed package metadata values" do
251
251
  expect(subject.send(:metadata_properties_for, package)).to include(package_properties.merge(build_values))
252
252
  end
253
253
 
254
- context ':build_record is false' do
254
+ context ":build_record is false" do
255
255
  let(:options) do
256
256
  {
257
257
  build_record: false,
@@ -259,7 +259,7 @@ module Omnibus
259
259
  }
260
260
  end
261
261
 
262
- it 'does not include `build.*` values' do
262
+ it "does not include `build.*` values" do
263
263
  expect(subject.send(:metadata_properties_for, package)).to include(package_properties)
264
264
  expect(subject.send(:metadata_properties_for, package)).to_not include(build_values)
265
265
  end