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
data/spec/unit/fetcher_spec.rb
CHANGED
@@ -1,34 +1,33 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "spec_helper"
|
2
|
+
require "omnibus/manifest_entry"
|
3
3
|
|
4
4
|
module Omnibus
|
5
5
|
describe Fetcher do
|
6
|
-
let(:source_path) {
|
7
|
-
let(:project_dir) {
|
8
|
-
let(:build_dir) {
|
6
|
+
let(:source_path) { "/local/path" }
|
7
|
+
let(:project_dir) { "/project/dir" }
|
8
|
+
let(:build_dir) { "/build/dir" }
|
9
9
|
|
10
10
|
let(:manifest_entry) do
|
11
11
|
double(Software,
|
12
|
-
name:
|
13
|
-
locked_version:
|
14
|
-
described_version:
|
12
|
+
name: "software",
|
13
|
+
locked_version: "31aedfs",
|
14
|
+
described_version: "mrfancypants",
|
15
15
|
locked_source: { path: source_path })
|
16
16
|
end
|
17
17
|
|
18
18
|
subject { described_class.new(manifest_entry, project_dir, build_dir) }
|
19
19
|
|
20
|
-
|
21
20
|
describe "#initialize" do
|
22
21
|
it "sets the resovled_version to the locked_version" do
|
23
22
|
expect(subject.resolved_version).to eq("31aedfs")
|
24
23
|
end
|
25
24
|
|
26
25
|
it "sets the source to the locked_source" do
|
27
|
-
expect(subject.source).to eq({ path: source_path})
|
26
|
+
expect(subject.source).to eq({ path: source_path })
|
28
27
|
end
|
29
28
|
|
30
|
-
it
|
31
|
-
expect(subject.described_version).to eq(
|
29
|
+
it "sets the described_version to the described version" do
|
30
|
+
expect(subject.described_version).to eq("mrfancypants")
|
32
31
|
end
|
33
32
|
end
|
34
33
|
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Omnibus
|
4
4
|
describe GitFetcher do
|
5
|
-
let(:source_path) {
|
6
|
-
let(:project_dir) {
|
7
|
-
let(:build_dir) {
|
5
|
+
let(:source_path) { "/local/path" }
|
6
|
+
let(:project_dir) { "/project/dir" }
|
7
|
+
let(:build_dir) { "/build/dir" }
|
8
8
|
|
9
9
|
let(:manifest_entry) do
|
10
10
|
double(ManifestEntry,
|
11
|
-
name:
|
12
|
-
locked_version:
|
13
|
-
described_version:
|
11
|
+
name: "software",
|
12
|
+
locked_version: "123abcd1234",
|
13
|
+
described_version: "some-git-ref",
|
14
14
|
locked_source: { path: source_path })
|
15
15
|
end
|
16
16
|
|
@@ -18,29 +18,29 @@ module Omnibus
|
|
18
18
|
|
19
19
|
describe '#fetch_required?' do
|
20
20
|
|
21
|
-
context
|
21
|
+
context "when the repository is not cloned" do
|
22
22
|
before { allow(subject).to receive(:cloned?).and_return(false) }
|
23
23
|
|
24
|
-
it
|
24
|
+
it "returns true" do
|
25
25
|
expect(subject.fetch_required?).to be_truthy
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
context
|
29
|
+
context "when the repository is cloned" do
|
30
30
|
before { allow(subject).to receive(:cloned?).and_return(true) }
|
31
|
-
before { allow(subject).to receive(:resolved_version).and_return(
|
32
|
-
context
|
31
|
+
before { allow(subject).to receive(:resolved_version).and_return("12341235") }
|
32
|
+
context "when the revision is not in the repo" do
|
33
33
|
before { allow(subject).to receive(:contains_revision?).and_return(false) }
|
34
34
|
|
35
|
-
it
|
35
|
+
it "returns true" do
|
36
36
|
expect(subject.fetch_required?).to be_truthy
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
context
|
40
|
+
context "when the revision is present in the repo" do
|
41
41
|
before { allow(subject).to receive(:contains_revision?).and_return(true) }
|
42
42
|
|
43
|
-
it
|
43
|
+
it "returns false" do
|
44
44
|
expect(subject.fetch_required?).to be(false)
|
45
45
|
end
|
46
46
|
end
|
@@ -48,13 +48,13 @@ module Omnibus
|
|
48
48
|
end
|
49
49
|
|
50
50
|
describe '#version_guid' do
|
51
|
-
let(:revision) {
|
51
|
+
let(:revision) { "abcd1234" }
|
52
52
|
|
53
53
|
before do
|
54
54
|
allow(subject).to receive(:current_revision).and_return(revision)
|
55
55
|
end
|
56
56
|
|
57
|
-
it
|
57
|
+
it "returns the revision" do
|
58
58
|
expect(subject.version_guid).to eq("git:#{revision}")
|
59
59
|
end
|
60
60
|
end
|
@@ -62,20 +62,20 @@ module Omnibus
|
|
62
62
|
describe '#clean' do
|
63
63
|
before do
|
64
64
|
allow(subject).to receive(:git)
|
65
|
-
allow(subject).to receive(:resolved_version).and_return(
|
65
|
+
allow(subject).to receive(:resolved_version).and_return("12341235")
|
66
66
|
end
|
67
67
|
|
68
|
-
it
|
68
|
+
it "checks out the working directory at the correct revision" do
|
69
69
|
expect(subject).to receive(:git_checkout)
|
70
70
|
subject.clean
|
71
71
|
end
|
72
72
|
|
73
|
-
it
|
74
|
-
expect(subject).to receive(:git).with(
|
73
|
+
it "cleans the directory" do
|
74
|
+
expect(subject).to receive(:git).with("clean -fdx")
|
75
75
|
subject.clean
|
76
76
|
end
|
77
77
|
|
78
|
-
it
|
78
|
+
it "returns true" do
|
79
79
|
expect(subject.clean).to be_truthy
|
80
80
|
end
|
81
81
|
end
|
@@ -85,33 +85,33 @@ module Omnibus
|
|
85
85
|
allow(subject).to receive(:create_required_directories)
|
86
86
|
end
|
87
87
|
|
88
|
-
context
|
88
|
+
context "when the repository is cloned" do
|
89
89
|
before { allow(subject).to receive(:cloned?).and_return(true) }
|
90
90
|
|
91
|
-
it
|
91
|
+
it "fetches the resolved_version" do
|
92
92
|
expect(subject).to receive(:git_fetch)
|
93
93
|
subject.fetch
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
context
|
97
|
+
context "when the repository is not cloned" do
|
98
98
|
before do
|
99
99
|
allow(subject).to receive(:cloned?).and_return(false)
|
100
100
|
allow(subject).to receive(:dir_empty?).and_return(true)
|
101
101
|
allow(subject).to receive(:git_clone)
|
102
102
|
end
|
103
103
|
|
104
|
-
context
|
105
|
-
before { expect(subject).to receive(:dir_empty?).with(project_dir).and_return(false)}
|
104
|
+
context "but a directory does exist" do
|
105
|
+
before { expect(subject).to receive(:dir_empty?).with(project_dir).and_return(false) }
|
106
106
|
|
107
|
-
it
|
107
|
+
it "forcefully removes and recreates the directory" do
|
108
108
|
expect(FileUtils).to receive(:rm_rf).with(project_dir).and_return(project_dir)
|
109
109
|
expect(Dir).to receive(:mkdir).with(project_dir).and_return(0)
|
110
110
|
subject.fetch
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
-
it
|
114
|
+
it "clones the repository and checks out the correct revision" do
|
115
115
|
expect(subject).to receive(:git_clone).once
|
116
116
|
subject.fetch
|
117
117
|
end
|
@@ -119,8 +119,8 @@ module Omnibus
|
|
119
119
|
end
|
120
120
|
|
121
121
|
describe '#version_for_cache' do
|
122
|
-
it
|
123
|
-
expect(subject.version_for_cache).to eq(
|
122
|
+
it "returns the shasum of the commit that we expect to be at" do
|
123
|
+
expect(subject.version_for_cache).to eq("revision:123abcd1234")
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|