omnibus 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/CHANGELOG.md +21 -0
- data/Gemfile +8 -5
- data/README.md +3 -1
- data/Rakefile +20 -13
- data/appveyor.yml +4 -3
- data/bin/omnibus +3 -3
- data/features/commands/manifest.feature +19 -5
- data/features/step_definitions/generator_steps.rb +5 -6
- data/features/support/env.rb +4 -4
- data/lib/omnibus/build_version.rb +14 -14
- data/lib/omnibus/build_version_dsl.rb +3 -3
- data/lib/omnibus/builder.rb +50 -61
- data/lib/omnibus/changelog.rb +2 -2
- data/lib/omnibus/changelog_printer.rb +4 -4
- data/lib/omnibus/cleaner.rb +4 -4
- data/lib/omnibus/cli/base.rb +15 -15
- data/lib/omnibus/cli/cache.rb +13 -13
- data/lib/omnibus/cli/changelog.rb +8 -9
- data/lib/omnibus/cli/publish.rb +12 -13
- data/lib/omnibus/cli.rb +26 -27
- data/lib/omnibus/compressor.rb +6 -6
- data/lib/omnibus/compressors/base.rb +7 -2
- data/lib/omnibus/compressors/dmg.rb +12 -12
- data/lib/omnibus/compressors/null.rb +1 -1
- data/lib/omnibus/compressors/tgz.rb +8 -8
- data/lib/omnibus/config.rb +37 -26
- data/lib/omnibus/core_extensions/open_uri.rb +3 -3
- data/lib/omnibus/core_extensions.rb +1 -1
- data/lib/omnibus/digestable.rb +5 -4
- data/lib/omnibus/download_helpers.rb +7 -6
- data/lib/omnibus/exceptions.rb +29 -13
- data/lib/omnibus/fetcher.rb +0 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
- data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +3 -3
- data/lib/omnibus/generator.rb +60 -47
- data/lib/omnibus/git_cache.rb +33 -22
- data/lib/omnibus/git_repository.rb +5 -5
- data/lib/omnibus/health_check.rb +122 -119
- data/lib/omnibus/instrumentation.rb +1 -1
- data/lib/omnibus/licensing.rb +348 -60
- data/lib/omnibus/logger.rb +12 -9
- data/lib/omnibus/logging.rb +1 -1
- data/lib/omnibus/manifest.rb +4 -4
- data/lib/omnibus/manifest_diff.rb +6 -7
- data/lib/omnibus/manifest_entry.rb +1 -1
- data/lib/omnibus/metadata.rb +36 -36
- data/lib/omnibus/ohai.rb +6 -7
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +37 -28
- data/lib/omnibus/packagers/appx.rb +86 -0
- data/lib/omnibus/packagers/base.rb +21 -18
- data/lib/omnibus/packagers/bff.rb +22 -24
- data/lib/omnibus/packagers/deb.rb +20 -20
- data/lib/omnibus/packagers/ips.rb +18 -17
- data/lib/omnibus/packagers/makeself.rb +7 -7
- data/lib/omnibus/packagers/msi.rb +38 -193
- data/lib/omnibus/packagers/pkg.rb +16 -16
- data/lib/omnibus/packagers/rpm.rb +53 -54
- data/lib/omnibus/packagers/solaris.rb +14 -14
- data/lib/omnibus/packagers/windows_base.rb +192 -0
- data/lib/omnibus/project.rb +45 -43
- data/lib/omnibus/publisher.rb +3 -3
- data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
- data/lib/omnibus/publishers/s3_publisher.rb +7 -7
- data/lib/omnibus/reports.rb +10 -10
- data/lib/omnibus/s3_cache.rb +7 -7
- data/lib/omnibus/s3_helpers.rb +8 -7
- data/lib/omnibus/semantic_version.rb +1 -1
- data/lib/omnibus/software.rb +131 -81
- data/lib/omnibus/sugarable.rb +10 -10
- data/lib/omnibus/templating.rb +5 -5
- data/lib/omnibus/thread_pool.rb +1 -1
- data/lib/omnibus/util.rb +5 -5
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus.rb +65 -65
- data/omnibus.gemspec +34 -32
- data/resources/appx/AppxManifest.xml.erb +18 -0
- data/resources/appx/assets/clear.png +0 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
- data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
- data/spec/functional/builder_spec.rb +149 -150
- data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
- data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
- data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
- data/spec/functional/file_syncer_spec.rb +74 -74
- data/spec/functional/licensing_spec.rb +344 -35
- data/spec/functional/templating_spec.rb +17 -17
- data/spec/spec_helper.rb +20 -20
- data/spec/support/examples.rb +21 -15
- data/spec/support/file_helpers.rb +1 -1
- data/spec/support/git_helpers.rb +37 -37
- data/spec/support/matchers.rb +3 -3
- data/spec/support/ohai_helpers.rb +4 -4
- data/spec/support/path_helpers.rb +2 -2
- data/spec/support/shell_helpers.rb +2 -2
- data/spec/unit/build_version_dsl_spec.rb +5 -5
- data/spec/unit/build_version_spec.rb +63 -63
- data/spec/unit/builder_spec.rb +86 -70
- data/spec/unit/changelog_spec.rb +4 -4
- data/spec/unit/changelogprinter_spec.rb +130 -0
- data/spec/unit/cleanroom_spec.rb +11 -11
- data/spec/unit/compressor_spec.rb +16 -16
- data/spec/unit/compressors/base_spec.rb +6 -6
- data/spec/unit/compressors/dmg_spec.rb +76 -76
- data/spec/unit/compressors/null_spec.rb +4 -4
- data/spec/unit/compressors/tgz_spec.rb +20 -20
- data/spec/unit/config_spec.rb +44 -43
- data/spec/unit/digestable_spec.rb +13 -13
- data/spec/unit/fetcher_spec.rb +11 -12
- data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
- data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
- data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
- data/spec/unit/generator_spec.rb +38 -38
- data/spec/unit/git_cache_spec.rb +56 -54
- data/spec/unit/git_repository_spec.rb +2 -2
- data/spec/unit/health_check_spec.rb +40 -40
- data/spec/unit/library_spec.rb +35 -35
- data/spec/unit/manifest_diff_spec.rb +10 -11
- data/spec/unit/manifest_spec.rb +17 -17
- data/spec/unit/metadata_spec.rb +152 -152
- data/spec/unit/ohai_spec.rb +5 -5
- data/spec/unit/omnibus_spec.rb +31 -31
- data/spec/unit/package_spec.rb +20 -20
- data/spec/unit/packager_spec.rb +48 -42
- data/spec/unit/packagers/appx_spec.rb +165 -0
- data/spec/unit/packagers/base_spec.rb +34 -34
- data/spec/unit/packagers/bff_spec.rb +60 -60
- data/spec/unit/packagers/deb_spec.rb +71 -71
- data/spec/unit/packagers/ips_spec.rb +45 -45
- data/spec/unit/packagers/makeself_spec.rb +22 -22
- data/spec/unit/packagers/msi_spec.rb +141 -147
- data/spec/unit/packagers/pkg_spec.rb +59 -60
- data/spec/unit/packagers/rpm_spec.rb +125 -126
- data/spec/unit/packagers/solaris_spec.rb +52 -52
- data/spec/unit/project_spec.rb +137 -135
- data/spec/unit/publisher_spec.rb +70 -70
- data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
- data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
- data/spec/unit/s3_cacher_spec.rb +34 -34
- data/spec/unit/s3_helpers_spec.rb +6 -6
- data/spec/unit/semantic_version_spec.rb +2 -2
- data/spec/unit/software_spec.rb +346 -384
- data/spec/unit/sugarable_spec.rb +10 -10
- data/spec/unit/util_spec.rb +60 -60
- metadata +54 -6
- data/.rubocop.yml +0 -48
@@ -1,36 +1,36 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Omnibus
|
4
4
|
describe S3Publisher do
|
5
|
-
let(:path) {
|
5
|
+
let(:path) { "/path/to/files/*.deb" }
|
6
6
|
|
7
7
|
let(:package) do
|
8
8
|
double(Package,
|
9
|
-
path:
|
10
|
-
name:
|
11
|
-
content:
|
12
|
-
validate!: true
|
9
|
+
path: "/path/to/files/chef.deb",
|
10
|
+
name: "chef.deb",
|
11
|
+
content: "BINARY",
|
12
|
+
validate!: true
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
16
16
|
let(:metadata) do
|
17
17
|
Metadata.new(package,
|
18
|
-
name:
|
19
|
-
friendly_name:
|
20
|
-
homepage:
|
21
|
-
version:
|
22
|
-
basename:
|
23
|
-
platform:
|
24
|
-
platform_version:
|
25
|
-
arch:
|
26
|
-
sha1:
|
27
|
-
md5:
|
18
|
+
name: "chef",
|
19
|
+
friendly_name: "Chef",
|
20
|
+
homepage: "https://getchef.com",
|
21
|
+
version: "11.0.6",
|
22
|
+
basename: "chef.deb",
|
23
|
+
platform: "ubuntu",
|
24
|
+
platform_version: "14.04",
|
25
|
+
arch: "x86_64",
|
26
|
+
sha1: "SHA1",
|
27
|
+
md5: "ABCDEF123456"
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
31
31
|
let(:packages) { [package] }
|
32
32
|
|
33
|
-
let(:client) { double(
|
33
|
+
let(:client) { double("Aws::S3::Resource") }
|
34
34
|
|
35
35
|
before do
|
36
36
|
allow(package).to receive(:metadata).and_return(metadata)
|
@@ -43,65 +43,65 @@ module Omnibus
|
|
43
43
|
describe '#publish' do
|
44
44
|
before { allow(subject).to receive(:packages).and_return(packages) }
|
45
45
|
|
46
|
-
it
|
46
|
+
it "validates the package" do
|
47
47
|
expect(package).to receive(:validate!).once
|
48
48
|
subject.publish
|
49
49
|
end
|
50
50
|
|
51
|
-
it
|
51
|
+
it "uploads the metadata" do
|
52
52
|
expect(subject).to receive(:store_object).with(
|
53
|
-
|
53
|
+
"ubuntu/14.04/x86_64/chef.deb/chef.deb.metadata.json",
|
54
54
|
FFI_Yajl::Encoder.encode(package.metadata.to_hash, pretty: true),
|
55
55
|
nil,
|
56
|
-
|
56
|
+
"private"
|
57
57
|
).once
|
58
58
|
|
59
59
|
subject.publish
|
60
60
|
end
|
61
61
|
|
62
|
-
it
|
62
|
+
it "uploads the package" do
|
63
63
|
expect(subject).to receive(:store_object).with(
|
64
|
-
|
64
|
+
"ubuntu/14.04/x86_64/chef.deb/chef.deb",
|
65
65
|
package.content,
|
66
66
|
package.metadata[:md5],
|
67
|
-
|
67
|
+
"private"
|
68
68
|
).once
|
69
69
|
|
70
70
|
subject.publish
|
71
71
|
end
|
72
72
|
|
73
|
-
context
|
74
|
-
subject { described_class.new(path, acl:
|
73
|
+
context "when the upload is set to public" do
|
74
|
+
subject { described_class.new(path, acl: "public") }
|
75
75
|
|
76
|
-
it
|
76
|
+
it "sets the access control to public_read" do
|
77
77
|
expect(subject).to receive(:store_object).with(
|
78
|
-
|
78
|
+
"ubuntu/14.04/x86_64/chef.deb/chef.deb.metadata.json",
|
79
79
|
FFI_Yajl::Encoder.encode(package.metadata.to_hash, pretty: true),
|
80
80
|
nil,
|
81
|
-
|
81
|
+
"public-read"
|
82
82
|
).once
|
83
83
|
|
84
84
|
subject.publish
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
-
context
|
89
|
-
subject { described_class.new(path, acl:
|
88
|
+
context "when the upload is set to a nonsensical value" do
|
89
|
+
subject { described_class.new(path, acl: "baconbits") }
|
90
90
|
|
91
|
-
it
|
91
|
+
it "sets the access control to private" do
|
92
92
|
expect(subject).to receive(:store_object).with(
|
93
|
-
|
93
|
+
"ubuntu/14.04/x86_64/chef.deb/chef.deb.metadata.json",
|
94
94
|
FFI_Yajl::Encoder.encode(package.metadata.to_hash, pretty: true),
|
95
95
|
nil,
|
96
|
-
|
96
|
+
"private"
|
97
97
|
).once
|
98
98
|
|
99
99
|
subject.publish
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
context
|
104
|
-
it
|
103
|
+
context "when a block is given" do
|
104
|
+
it "yields the package to the block" do
|
105
105
|
block = ->(package) { package.do_something! }
|
106
106
|
expect(package).to receive(:do_something!).once
|
107
107
|
subject.publish(&block)
|
data/spec/unit/s3_cacher_spec.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Omnibus
|
4
4
|
describe S3Cache do
|
5
5
|
let(:ruby_19) do
|
6
|
-
double(
|
7
|
-
name:
|
8
|
-
version:
|
6
|
+
double("ruby_19",
|
7
|
+
name: "ruby",
|
8
|
+
version: "1.9.3",
|
9
9
|
fetcher: double(Fetcher,
|
10
|
-
checksum:
|
11
|
-
)
|
10
|
+
checksum: "abcd1234"
|
11
|
+
)
|
12
12
|
)
|
13
13
|
end
|
14
14
|
|
15
15
|
let(:python_27) do
|
16
|
-
double(
|
17
|
-
name:
|
18
|
-
version:
|
16
|
+
double("python",
|
17
|
+
name: "python",
|
18
|
+
version: "2.7",
|
19
19
|
fetcher: double(Fetcher,
|
20
|
-
checksum:
|
21
|
-
)
|
20
|
+
checksum: "defg5678"
|
21
|
+
)
|
22
22
|
)
|
23
23
|
end
|
24
24
|
|
25
|
-
describe
|
26
|
-
let(:keys) { %w
|
25
|
+
describe ".list" do
|
26
|
+
let(:keys) { %w{ruby-1.9.3-abcd1234 python-2.7.defg5678} }
|
27
27
|
let(:softwares) { [ruby_19, python_27] }
|
28
28
|
|
29
29
|
before do
|
@@ -31,25 +31,25 @@ module Omnibus
|
|
31
31
|
allow(S3Cache).to receive(:softwares).and_return(softwares)
|
32
32
|
end
|
33
33
|
|
34
|
-
it
|
34
|
+
it "lists the software that is cached on S3" do
|
35
35
|
expect(S3Cache.list).to include(ruby_19)
|
36
36
|
expect(S3Cache.list).to_not include(python_27)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
describe
|
40
|
+
describe ".keys" do
|
41
41
|
let(:bucket) { double(:bucket, objects: []) }
|
42
42
|
|
43
43
|
before { allow(S3Cache).to receive(:bucket).and_return(bucket) }
|
44
44
|
|
45
|
-
it
|
45
|
+
it "lists the keys on the S3 bucket" do
|
46
46
|
expect(bucket).to receive(:objects).once
|
47
47
|
S3Cache.keys
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
describe
|
52
|
-
let(:keys) { %w
|
51
|
+
describe ".missing" do
|
52
|
+
let(:keys) { %w{ruby-1.9.3-abcd1234 python-2.7.defg5678} }
|
53
53
|
let(:softwares) { [ruby_19, python_27] }
|
54
54
|
|
55
55
|
before do
|
@@ -57,22 +57,22 @@ module Omnibus
|
|
57
57
|
allow(S3Cache).to receive(:softwares).and_return(softwares)
|
58
58
|
end
|
59
59
|
|
60
|
-
it
|
60
|
+
it "lists the software that is cached on S3" do
|
61
61
|
expect(S3Cache.missing).to_not include(ruby_19)
|
62
62
|
expect(S3Cache.missing).to include(python_27)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
describe
|
67
|
-
it
|
66
|
+
describe ".populate" do
|
67
|
+
it "pending a good samaritan to come along and write tests..."
|
68
68
|
end
|
69
69
|
|
70
|
-
describe
|
70
|
+
describe ".fetch_missing" do
|
71
71
|
let(:softwares) { [ruby_19, python_27] }
|
72
72
|
|
73
73
|
before { allow(S3Cache).to receive(:missing).and_return(softwares) }
|
74
74
|
|
75
|
-
it
|
75
|
+
it "fetches the missing software" do
|
76
76
|
expect(ruby_19).to receive(:fetch)
|
77
77
|
expect(python_27).to receive(:fetch)
|
78
78
|
|
@@ -80,30 +80,30 @@ module Omnibus
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe
|
84
|
-
context
|
85
|
-
it
|
83
|
+
describe ".key_for" do
|
84
|
+
context "when the package does not have a name" do
|
85
|
+
it "raises an exception" do
|
86
86
|
expect { S3Cache.key_for(double(name: nil)) }
|
87
87
|
.to raise_error(InsufficientSpecification)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
context
|
92
|
-
it
|
93
|
-
expect { S3Cache.key_for(double(name:
|
91
|
+
context "when the package does not have a version" do
|
92
|
+
it "raises an exception" do
|
93
|
+
expect { S3Cache.key_for(double(name: "ruby", version: nil)) }
|
94
94
|
.to raise_error(InsufficientSpecification)
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
context
|
99
|
-
it
|
100
|
-
expect { S3Cache.key_for(double(name:
|
98
|
+
context "when the package does not have a checksum" do
|
99
|
+
it "raises an exception" do
|
100
|
+
expect { S3Cache.key_for(double(name: "ruby", version: "1.9.3", fetcher: double(Fetcher, checksum: nil))) }
|
101
101
|
.to raise_error(InsufficientSpecification)
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
it
|
106
|
-
expect(S3Cache.key_for(ruby_19)).to eq(
|
105
|
+
it "returns the correct string" do
|
106
|
+
expect(S3Cache.key_for(ruby_19)).to eq("ruby-1.9.3-abcd1234")
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "spec_helper"
|
2
|
+
require "omnibus/s3_helpers"
|
3
3
|
|
4
4
|
module Omnibus
|
5
5
|
describe S3Helpers do
|
@@ -7,12 +7,12 @@ module Omnibus
|
|
7
7
|
|
8
8
|
context 'when #s3_configuration is not defined' do
|
9
9
|
describe '#client' do
|
10
|
-
it
|
10
|
+
it "raises an error if it is not overridden" do
|
11
11
|
expect { s3_configuration }.to raise_error(RuntimeError,
|
12
12
|
"You must override s3_configuration")
|
13
13
|
end
|
14
14
|
|
15
|
-
it
|
15
|
+
it "raises an error stating that s3_configuration must be overriden" do
|
16
16
|
expect { client }.to raise_error(RuntimeError,
|
17
17
|
"You must override s3_configuration")
|
18
18
|
end
|
@@ -21,10 +21,10 @@ module Omnibus
|
|
21
21
|
|
22
22
|
describe '#to_base64_digest' do
|
23
23
|
it 'turns "c3b5247592ce694f7097873aa07d66fe" into "w7UkdZLOaU9wl4c6oH1m/g=="' do
|
24
|
-
expect(to_base64_digest("c3b5247592ce694f7097873aa07d66fe")).to eql(
|
24
|
+
expect(to_base64_digest("c3b5247592ce694f7097873aa07d66fe")).to eql("w7UkdZLOaU9wl4c6oH1m/g==")
|
25
25
|
end
|
26
26
|
|
27
|
-
it
|
27
|
+
it "allows a nil input without error" do
|
28
28
|
expect(to_base64_digest(nil)).to be_nil
|
29
29
|
end
|
30
30
|
end
|
@@ -13,13 +13,13 @@
|
|
13
13
|
# See the License for the specific language governing permissions and
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
|
-
require
|
16
|
+
require "spec_helper"
|
17
17
|
|
18
18
|
module Omnibus
|
19
19
|
describe SemanticVersion do
|
20
20
|
|
21
21
|
it "raises an InvalidVersion error if it doesn't understand the format" do
|
22
|
-
expect {Omnibus::SemanticVersion.new("wut")}.to raise_error(Omnibus::InvalidVersion)
|
22
|
+
expect { Omnibus::SemanticVersion.new("wut") }.to raise_error(Omnibus::InvalidVersion)
|
23
23
|
end
|
24
24
|
|
25
25
|
it "preserves leading the leading v when printing the string" do
|