omnibus 5.5.0 → 5.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +11 -0
  3. data/.travis.yml +2 -1
  4. data/CHANGELOG.md +37 -0
  5. data/Gemfile +5 -4
  6. data/MAINTAINERS.md +12 -17
  7. data/README.md +98 -107
  8. data/appveyor.yml +1 -1
  9. data/lib/omnibus.rb +4 -4
  10. data/lib/omnibus/builder.rb +42 -9
  11. data/lib/omnibus/cli.rb +5 -0
  12. data/lib/omnibus/cli/base.rb +1 -1
  13. data/lib/omnibus/cli/publish.rb +5 -3
  14. data/lib/omnibus/compressors/dmg.rb +2 -2
  15. data/lib/omnibus/config.rb +42 -5
  16. data/lib/omnibus/core_extensions/open_uri.rb +1 -0
  17. data/lib/omnibus/download_helpers.rb +4 -4
  18. data/lib/omnibus/fetchers/git_fetcher.rb +15 -5
  19. data/lib/omnibus/fetchers/net_fetcher.rb +1 -1
  20. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  21. data/lib/omnibus/file_syncer.rb +2 -2
  22. data/lib/omnibus/generator_files/omnibus.rb.erb +1 -0
  23. data/lib/omnibus/git_cache.rb +31 -13
  24. data/lib/omnibus/health_check.rb +1 -173
  25. data/lib/omnibus/licensing.rb +48 -7
  26. data/lib/omnibus/manifest.rb +3 -5
  27. data/lib/omnibus/manifest_entry.rb +1 -1
  28. data/lib/omnibus/metadata.rb +2 -1
  29. data/lib/omnibus/packager.rb +3 -1
  30. data/lib/omnibus/packagers/appx.rb +3 -3
  31. data/lib/omnibus/packagers/base.rb +9 -0
  32. data/lib/omnibus/packagers/bff.rb +4 -6
  33. data/lib/omnibus/packagers/deb.rb +95 -1
  34. data/lib/omnibus/packagers/ips.rb +50 -4
  35. data/lib/omnibus/packagers/pkgsrc.rb +112 -0
  36. data/lib/omnibus/packagers/rpm.rb +72 -3
  37. data/lib/omnibus/packagers/solaris.rb +0 -4
  38. data/lib/omnibus/packagers/windows_base.rb +1 -1
  39. data/lib/omnibus/project.rb +13 -3
  40. data/lib/omnibus/publishers/artifactory_publisher.rb +4 -6
  41. data/lib/omnibus/publishers/s3_publisher.rb +8 -3
  42. data/lib/omnibus/reports.rb +1 -1
  43. data/lib/omnibus/s3_cache.rb +18 -5
  44. data/lib/omnibus/s3_helpers.rb +45 -8
  45. data/lib/omnibus/software.rb +55 -37
  46. data/lib/omnibus/sugarable.rb +4 -0
  47. data/lib/omnibus/templating.rb +29 -13
  48. data/lib/omnibus/util.rb +81 -2
  49. data/lib/omnibus/version.rb +1 -1
  50. data/lib/omnibus/whitelist.rb +228 -0
  51. data/omnibus.gemspec +9 -8
  52. data/resources/dmg/create_dmg.osascript.erb +33 -13
  53. data/resources/ips/doc-transform.erb +2 -0
  54. data/resources/rpm/spec.erb +1 -2
  55. data/spec/functional/builder_spec.rb +21 -21
  56. data/spec/functional/fetchers/git_fetcher_spec.rb +6 -6
  57. data/spec/functional/fetchers/net_fetcher_spec.rb +7 -7
  58. data/spec/functional/fetchers/path_fetcher_spec.rb +5 -5
  59. data/spec/functional/file_syncer_spec.rb +6 -6
  60. data/spec/functional/licensing_spec.rb +29 -16
  61. data/spec/functional/templating_spec.rb +23 -22
  62. data/spec/support/git_helpers.rb +30 -24
  63. data/spec/unit/build_version_spec.rb +1 -1
  64. data/spec/unit/builder_spec.rb +36 -24
  65. data/spec/unit/changelogprinter_spec.rb +10 -8
  66. data/spec/unit/cleanroom_spec.rb +6 -6
  67. data/spec/unit/compressors/dmg_spec.rb +23 -37
  68. data/spec/unit/compressors/null_spec.rb +2 -2
  69. data/spec/unit/compressors/tgz_spec.rb +2 -2
  70. data/spec/unit/config_spec.rb +2 -1
  71. data/spec/unit/digestable_spec.rb +2 -2
  72. data/spec/unit/fetchers/git_fetcher_spec.rb +5 -5
  73. data/spec/unit/fetchers/net_fetcher_spec.rb +46 -6
  74. data/spec/unit/fetchers/path_fetcher_spec.rb +5 -5
  75. data/spec/unit/file_syncer_spec.rb +19 -0
  76. data/spec/unit/git_cache_spec.rb +76 -22
  77. data/spec/unit/health_check_spec.rb +1 -1
  78. data/spec/unit/library_spec.rb +2 -2
  79. data/spec/unit/manifest_spec.rb +6 -6
  80. data/spec/unit/metadata_spec.rb +4 -4
  81. data/spec/unit/omnibus_spec.rb +4 -4
  82. data/spec/unit/package_spec.rb +6 -6
  83. data/spec/unit/packagers/appx_spec.rb +16 -12
  84. data/spec/unit/packagers/base_spec.rb +5 -5
  85. data/spec/unit/packagers/bff_spec.rb +45 -15
  86. data/spec/unit/packagers/deb_spec.rb +95 -17
  87. data/spec/unit/packagers/ips_spec.rb +61 -17
  88. data/spec/unit/packagers/makeself_spec.rb +5 -5
  89. data/spec/unit/packagers/msi_spec.rb +43 -43
  90. data/spec/unit/packagers/pkg_spec.rb +15 -15
  91. data/spec/unit/packagers/pkgsrc_spec.rb +77 -0
  92. data/spec/unit/packagers/rpm_spec.rb +94 -17
  93. data/spec/unit/packagers/solaris_spec.rb +11 -11
  94. data/spec/unit/project_spec.rb +53 -22
  95. data/spec/unit/publisher_spec.rb +2 -2
  96. data/spec/unit/publishers/artifactory_publisher_spec.rb +7 -3
  97. data/spec/unit/publishers/s3_publisher_spec.rb +1 -1
  98. data/spec/unit/s3_helpers_spec.rb +41 -3
  99. data/spec/unit/software_spec.rb +115 -37
  100. data/spec/unit/sugarable_spec.rb +23 -3
  101. data/spec/unit/util_spec.rb +42 -11
  102. metadata +49 -29
@@ -12,7 +12,7 @@ module Omnibus
12
12
  expect(described_class.singleton_class.included_modules).to include(Sugarable)
13
13
  end
14
14
 
15
- it "includes Sugarable" do
15
+ it "is a sugarable" do
16
16
  expect(described_class.ancestors).to include(Sugarable)
17
17
  end
18
18
  end
@@ -47,13 +47,33 @@ module Omnibus
47
47
  end
48
48
 
49
49
  it "makes the DSL methods available in the cleanroom" do
50
- expect {
50
+ expect do
51
51
  instance.evaluate <<-EOH.gsub(/^ {12}/, "")
52
52
  windows?
53
53
  vagrant?
54
54
  EOH
55
- }.to_not raise_error
55
+ end.to_not raise_error
56
+ end
57
+ end
58
+ end
59
+
60
+ describe Sugar do
61
+ let(:klass) do
62
+ Class.new do
63
+ include Sugar
56
64
  end
57
65
  end
66
+
67
+ let(:instance) { klass.new }
68
+
69
+ it "returns the windows architecture being built" do
70
+ expect(Omnibus::Config).to receive(:windows_arch).and_return(:x86_64)
71
+ expect(instance.windows_arch_i386?).to eq(false)
72
+ end
73
+
74
+ it "returns whether fips_mode is enabled" do
75
+ expect(Omnibus::Config).to receive(:fips_mode).and_return(false)
76
+ expect(instance.fips_mode?).to eq(false)
77
+ end
58
78
  end
59
79
  end
@@ -4,7 +4,38 @@ module Omnibus
4
4
  describe Util do
5
5
  subject { Class.new { include Util }.new }
6
6
 
7
- describe '#shellout!' do
7
+ describe "#retry_block" do
8
+ class OurTestException < StandardError; end
9
+ let(:expected_retries) { 3 }
10
+ let(:expected_calls) { expected_retries + 1 }
11
+ let(:sentinel) { double }
12
+
13
+ it "retries the block if the passed exception is raised" do
14
+ expect(sentinel).to receive(:call_me).and_raise(OurTestException)
15
+ expect(sentinel).to receive(:call_me).and_return(:test_return)
16
+ block_return = nil
17
+ expect do
18
+ block_return = subject.retry_block("test", [OurTestException], expected_retries) { sentinel.call_me }
19
+ end.to_not raise_error
20
+ expect(block_return).to eq(:test_return)
21
+ end
22
+
23
+ it "raises the last exception if the number of retries is exceeded" do
24
+ expect(sentinel).to receive(:call_me).exactly(expected_calls).times.and_raise(OurTestException)
25
+ expect do
26
+ subject.retry_block("test", [OurTestException], expected_retries) { sentinel.call_me }
27
+ end.to raise_error(OurTestException)
28
+ end
29
+
30
+ it "doesn't retry exceptions not listed by the user" do
31
+ expect(sentinel).to receive(:call_me).exactly(1).times.and_raise(StandardError)
32
+ expect do
33
+ subject.retry_block("test", [OurTestException], expected_retries) { sentinel.call_me }
34
+ end.to raise_error(StandardError)
35
+ end
36
+ end
37
+
38
+ describe "#shellout!" do
8
39
  let(:shellout) do
9
40
  double(Mixlib::ShellOut,
10
41
  command: "evil command",
@@ -28,9 +59,9 @@ module Omnibus
28
59
  end
29
60
 
30
61
  it "raises an CommandFailed exception" do
31
- expect {
62
+ expect do
32
63
  subject.shellout!
33
- }.to raise_error(CommandFailed) { |error|
64
+ end.to raise_error(CommandFailed) { |error|
34
65
  message = error.message
35
66
 
36
67
  expect(message).to include("$ I_LOVE_YOU=barney TICKLE_ME=elmo evil command")
@@ -49,9 +80,9 @@ module Omnibus
49
80
  end
50
81
 
51
82
  it "raises an CommandFailed exception" do
52
- expect {
83
+ expect do
53
84
  subject.shellout!
54
- }.to raise_error(CommandTimeout) { |error|
85
+ end.to raise_error(CommandTimeout) { |error|
55
86
  message = error.message
56
87
 
57
88
  expect(message).to include("shell command timed out at 7,200 seconds")
@@ -62,7 +93,7 @@ module Omnibus
62
93
  end
63
94
  end
64
95
 
65
- describe '#create_directory' do
96
+ describe "#create_directory" do
66
97
  before { allow(FileUtils).to receive(:mkdir_p) }
67
98
 
68
99
  it "creates the directory" do
@@ -80,7 +111,7 @@ module Omnibus
80
111
  end
81
112
  end
82
113
 
83
- describe '#remove_directory' do
114
+ describe "#remove_directory" do
84
115
  before { allow(FileUtils).to receive(:rm_rf) }
85
116
 
86
117
  it "remove the directory" do
@@ -99,7 +130,7 @@ module Omnibus
99
130
  end
100
131
  end
101
132
 
102
- describe '#copy_file' do
133
+ describe "#copy_file" do
103
134
  before { allow(FileUtils).to receive(:cp) }
104
135
 
105
136
  it "copies the file" do
@@ -117,7 +148,7 @@ module Omnibus
117
148
  end
118
149
  end
119
150
 
120
- describe '#remove_file' do
151
+ describe "#remove_file" do
121
152
  before { allow(FileUtils).to receive(:rm_f) }
122
153
 
123
154
  it "removes the file" do
@@ -136,7 +167,7 @@ module Omnibus
136
167
  end
137
168
  end
138
169
 
139
- describe '#create_file' do
170
+ describe "#create_file" do
140
171
  before do
141
172
  allow(FileUtils).to receive(:mkdir_p)
142
173
  allow(FileUtils).to receive(:touch)
@@ -171,7 +202,7 @@ module Omnibus
171
202
  end
172
203
  end
173
204
 
174
- describe '#create_link' do
205
+ describe "#create_link" do
175
206
  before { allow(FileUtils).to receive(:ln_s) }
176
207
 
177
208
  it "creates the directory" do
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.0
4
+ version: 5.6.0
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: 2016-08-16 00:00:00.000000000 Z
11
+ date: 2017-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: chef-sugar
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,33 +53,33 @@ dependencies:
39
53
  - !ruby/object:Gem::Version
40
54
  version: '1.0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: mixlib-shellout
56
+ name: ffi-yajl
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '2.0'
61
+ version: '2.2'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '2.0'
68
+ version: '2.2'
55
69
  - !ruby/object:Gem::Dependency
56
- name: mixlib-versioning
70
+ name: mixlib-shellout
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ">="
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: '2.0'
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ">="
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0'
82
+ version: '2.0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: ohai
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -95,47 +109,47 @@ dependencies:
95
109
  - !ruby/object:Gem::Version
96
110
  version: '1.7'
97
111
  - !ruby/object:Gem::Dependency
98
- name: aws-sdk
112
+ name: thor
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '2'
117
+ version: '0.18'
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: '2'
124
+ version: '0.18'
111
125
  - !ruby/object:Gem::Dependency
112
- name: thor
126
+ name: mixlib-versioning
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - "~>"
129
+ - - ">="
116
130
  - !ruby/object:Gem::Version
117
- version: '0.18'
131
+ version: '0'
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - "~>"
136
+ - - ">="
123
137
  - !ruby/object:Gem::Version
124
- version: '0.18'
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
- name: ffi-yajl
140
+ name: pedump
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
- - - "~>"
143
+ - - ">="
130
144
  - !ruby/object:Gem::Version
131
- version: '2.2'
145
+ version: '0'
132
146
  type: :runtime
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
- - - "~>"
150
+ - - ">="
137
151
  - !ruby/object:Gem::Version
138
- version: '2.2'
152
+ version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: license_scout
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -196,16 +210,16 @@ dependencies:
196
210
  name: chefstyle
197
211
  requirement: !ruby/object:Gem::Requirement
198
212
  requirements:
199
- - - "~>"
213
+ - - ">="
200
214
  - !ruby/object:Gem::Version
201
- version: '0.3'
215
+ version: '0'
202
216
  type: :development
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
- - - "~>"
220
+ - - ">="
207
221
  - !ruby/object:Gem::Version
208
- version: '0.3'
222
+ version: '0'
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: fauxhai
211
225
  requirement: !ruby/object:Gem::Requirement
@@ -422,6 +436,7 @@ files:
422
436
  - lib/omnibus/packagers/makeself.rb
423
437
  - lib/omnibus/packagers/msi.rb
424
438
  - lib/omnibus/packagers/pkg.rb
439
+ - lib/omnibus/packagers/pkgsrc.rb
425
440
  - lib/omnibus/packagers/rpm.rb
426
441
  - lib/omnibus/packagers/solaris.rb
427
442
  - lib/omnibus/packagers/windows_base.rb
@@ -440,6 +455,7 @@ files:
440
455
  - lib/omnibus/thread_pool.rb
441
456
  - lib/omnibus/util.rb
442
457
  - lib/omnibus/version.rb
458
+ - lib/omnibus/whitelist.rb
443
459
  - omnibus.gemspec
444
460
  - resources/appx/AppxManifest.xml.erb
445
461
  - resources/appx/assets/clear.png
@@ -518,6 +534,7 @@ files:
518
534
  - spec/unit/fetchers/git_fetcher_spec.rb
519
535
  - spec/unit/fetchers/net_fetcher_spec.rb
520
536
  - spec/unit/fetchers/path_fetcher_spec.rb
537
+ - spec/unit/file_syncer_spec.rb
521
538
  - spec/unit/generator_spec.rb
522
539
  - spec/unit/git_cache_spec.rb
523
540
  - spec/unit/git_repository_spec.rb
@@ -538,6 +555,7 @@ files:
538
555
  - spec/unit/packagers/makeself_spec.rb
539
556
  - spec/unit/packagers/msi_spec.rb
540
557
  - spec/unit/packagers/pkg_spec.rb
558
+ - spec/unit/packagers/pkgsrc_spec.rb
541
559
  - spec/unit/packagers/rpm_spec.rb
542
560
  - spec/unit/packagers/solaris_spec.rb
543
561
  - spec/unit/project_spec.rb
@@ -562,7 +580,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
562
580
  requirements:
563
581
  - - ">="
564
582
  - !ruby/object:Gem::Version
565
- version: '2.1'
583
+ version: '2.2'
566
584
  required_rubygems_version: !ruby/object:Gem::Requirement
567
585
  requirements:
568
586
  - - ">="
@@ -570,7 +588,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
570
588
  version: '0'
571
589
  requirements: []
572
590
  rubyforge_project:
573
- rubygems_version: 2.6.6
591
+ rubygems_version: 2.6.11
574
592
  signing_key:
575
593
  specification_version: 4
576
594
  summary: Omnibus is a framework for building self-installing, full-stack software
@@ -628,6 +646,7 @@ test_files:
628
646
  - spec/unit/fetchers/git_fetcher_spec.rb
629
647
  - spec/unit/fetchers/net_fetcher_spec.rb
630
648
  - spec/unit/fetchers/path_fetcher_spec.rb
649
+ - spec/unit/file_syncer_spec.rb
631
650
  - spec/unit/generator_spec.rb
632
651
  - spec/unit/git_cache_spec.rb
633
652
  - spec/unit/git_repository_spec.rb
@@ -648,6 +667,7 @@ test_files:
648
667
  - spec/unit/packagers/makeself_spec.rb
649
668
  - spec/unit/packagers/msi_spec.rb
650
669
  - spec/unit/packagers/pkg_spec.rb
670
+ - spec/unit/packagers/pkgsrc_spec.rb
651
671
  - spec/unit/packagers/rpm_spec.rb
652
672
  - spec/unit/packagers/solaris_spec.rb
653
673
  - spec/unit/project_spec.rb