omnibus 5.5.0 → 5.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +11 -0
- data/.travis.yml +2 -1
- data/CHANGELOG.md +37 -0
- data/Gemfile +5 -4
- data/MAINTAINERS.md +12 -17
- data/README.md +98 -107
- data/appveyor.yml +1 -1
- data/lib/omnibus.rb +4 -4
- data/lib/omnibus/builder.rb +42 -9
- data/lib/omnibus/cli.rb +5 -0
- data/lib/omnibus/cli/base.rb +1 -1
- data/lib/omnibus/cli/publish.rb +5 -3
- data/lib/omnibus/compressors/dmg.rb +2 -2
- data/lib/omnibus/config.rb +42 -5
- data/lib/omnibus/core_extensions/open_uri.rb +1 -0
- data/lib/omnibus/download_helpers.rb +4 -4
- data/lib/omnibus/fetchers/git_fetcher.rb +15 -5
- data/lib/omnibus/fetchers/net_fetcher.rb +1 -1
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +2 -2
- data/lib/omnibus/generator_files/omnibus.rb.erb +1 -0
- data/lib/omnibus/git_cache.rb +31 -13
- data/lib/omnibus/health_check.rb +1 -173
- data/lib/omnibus/licensing.rb +48 -7
- data/lib/omnibus/manifest.rb +3 -5
- data/lib/omnibus/manifest_entry.rb +1 -1
- data/lib/omnibus/metadata.rb +2 -1
- data/lib/omnibus/packager.rb +3 -1
- data/lib/omnibus/packagers/appx.rb +3 -3
- data/lib/omnibus/packagers/base.rb +9 -0
- data/lib/omnibus/packagers/bff.rb +4 -6
- data/lib/omnibus/packagers/deb.rb +95 -1
- data/lib/omnibus/packagers/ips.rb +50 -4
- data/lib/omnibus/packagers/pkgsrc.rb +112 -0
- data/lib/omnibus/packagers/rpm.rb +72 -3
- data/lib/omnibus/packagers/solaris.rb +0 -4
- data/lib/omnibus/packagers/windows_base.rb +1 -1
- data/lib/omnibus/project.rb +13 -3
- data/lib/omnibus/publishers/artifactory_publisher.rb +4 -6
- data/lib/omnibus/publishers/s3_publisher.rb +8 -3
- data/lib/omnibus/reports.rb +1 -1
- data/lib/omnibus/s3_cache.rb +18 -5
- data/lib/omnibus/s3_helpers.rb +45 -8
- data/lib/omnibus/software.rb +55 -37
- data/lib/omnibus/sugarable.rb +4 -0
- data/lib/omnibus/templating.rb +29 -13
- data/lib/omnibus/util.rb +81 -2
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus/whitelist.rb +228 -0
- data/omnibus.gemspec +9 -8
- data/resources/dmg/create_dmg.osascript.erb +33 -13
- data/resources/ips/doc-transform.erb +2 -0
- data/resources/rpm/spec.erb +1 -2
- data/spec/functional/builder_spec.rb +21 -21
- data/spec/functional/fetchers/git_fetcher_spec.rb +6 -6
- data/spec/functional/fetchers/net_fetcher_spec.rb +7 -7
- data/spec/functional/fetchers/path_fetcher_spec.rb +5 -5
- data/spec/functional/file_syncer_spec.rb +6 -6
- data/spec/functional/licensing_spec.rb +29 -16
- data/spec/functional/templating_spec.rb +23 -22
- data/spec/support/git_helpers.rb +30 -24
- data/spec/unit/build_version_spec.rb +1 -1
- data/spec/unit/builder_spec.rb +36 -24
- data/spec/unit/changelogprinter_spec.rb +10 -8
- data/spec/unit/cleanroom_spec.rb +6 -6
- data/spec/unit/compressors/dmg_spec.rb +23 -37
- data/spec/unit/compressors/null_spec.rb +2 -2
- data/spec/unit/compressors/tgz_spec.rb +2 -2
- data/spec/unit/config_spec.rb +2 -1
- data/spec/unit/digestable_spec.rb +2 -2
- data/spec/unit/fetchers/git_fetcher_spec.rb +5 -5
- data/spec/unit/fetchers/net_fetcher_spec.rb +46 -6
- data/spec/unit/fetchers/path_fetcher_spec.rb +5 -5
- data/spec/unit/file_syncer_spec.rb +19 -0
- data/spec/unit/git_cache_spec.rb +76 -22
- data/spec/unit/health_check_spec.rb +1 -1
- data/spec/unit/library_spec.rb +2 -2
- data/spec/unit/manifest_spec.rb +6 -6
- data/spec/unit/metadata_spec.rb +4 -4
- data/spec/unit/omnibus_spec.rb +4 -4
- data/spec/unit/package_spec.rb +6 -6
- data/spec/unit/packagers/appx_spec.rb +16 -12
- data/spec/unit/packagers/base_spec.rb +5 -5
- data/spec/unit/packagers/bff_spec.rb +45 -15
- data/spec/unit/packagers/deb_spec.rb +95 -17
- data/spec/unit/packagers/ips_spec.rb +61 -17
- data/spec/unit/packagers/makeself_spec.rb +5 -5
- data/spec/unit/packagers/msi_spec.rb +43 -43
- data/spec/unit/packagers/pkg_spec.rb +15 -15
- data/spec/unit/packagers/pkgsrc_spec.rb +77 -0
- data/spec/unit/packagers/rpm_spec.rb +94 -17
- data/spec/unit/packagers/solaris_spec.rb +11 -11
- data/spec/unit/project_spec.rb +53 -22
- data/spec/unit/publisher_spec.rb +2 -2
- data/spec/unit/publishers/artifactory_publisher_spec.rb +7 -3
- data/spec/unit/publishers/s3_publisher_spec.rb +1 -1
- data/spec/unit/s3_helpers_spec.rb +41 -3
- data/spec/unit/software_spec.rb +115 -37
- data/spec/unit/sugarable_spec.rb +23 -3
- data/spec/unit/util_spec.rb +42 -11
- metadata +49 -29
@@ -7,13 +7,13 @@ module Omnibus
|
|
7
7
|
|
8
8
|
subject { described_class.new(project) }
|
9
9
|
|
10
|
-
describe
|
10
|
+
describe "#id" do
|
11
11
|
it "is :dmg" do
|
12
12
|
expect(subject.id).to eq(:null)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
describe
|
16
|
+
describe "#run!" do
|
17
17
|
it "does nothing" do
|
18
18
|
expect(subject).to_not receive(:instance_eval)
|
19
19
|
subject.run!
|
@@ -36,13 +36,13 @@ module Omnibus
|
|
36
36
|
allow(subject).to receive(:shellout!)
|
37
37
|
end
|
38
38
|
|
39
|
-
describe
|
39
|
+
describe "#package_name" do
|
40
40
|
it "returns the name of the packager" do
|
41
41
|
expect(subject.package_name).to eq("project-1.2.3-2.pkg.tar.gz")
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
describe
|
45
|
+
describe "#write_tgz" do
|
46
46
|
before do
|
47
47
|
File.open("#{staging_dir}/project-1.2.3-2.pkg", "wb") do |f|
|
48
48
|
f.write " " * 1_000_000
|
data/spec/unit/config_spec.rb
CHANGED
@@ -45,8 +45,9 @@ module Omnibus
|
|
45
45
|
include_examples "a configurable", :fetcher_read_timeout, 60
|
46
46
|
include_examples "a configurable", :fetcher_retries, 5
|
47
47
|
include_examples "a configurable", :fatal_licensing_warnings, false
|
48
|
+
include_examples "a configurable", :fips_mode, false
|
48
49
|
|
49
|
-
describe
|
50
|
+
describe "#workers" do
|
50
51
|
context "when the Ohai data is not present" do
|
51
52
|
before do
|
52
53
|
stub_ohai(platform: "ubuntu", version: "12.04") do |data|
|
@@ -7,14 +7,14 @@ module Omnibus
|
|
7
7
|
|
8
8
|
subject { Class.new { include Digestable }.new }
|
9
9
|
|
10
|
-
describe
|
10
|
+
describe "#digest" do
|
11
11
|
it "reads the IO in chunks" do
|
12
12
|
expect(File).to receive(:open).with(path).and_yield(io)
|
13
13
|
expect(subject.digest(path)).to eq("d41d8cd98f00b204e9800998ecf8427e")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
describe
|
17
|
+
describe "#digest_directory" do
|
18
18
|
let(:path) { "/path/to/dir" }
|
19
19
|
let(:glob) { "#{path}/**/*" }
|
20
20
|
let(:subdir) { "/path/to/dir/subdir" }
|
@@ -16,7 +16,7 @@ module Omnibus
|
|
16
16
|
|
17
17
|
subject { described_class.new(manifest_entry, project_dir, build_dir) }
|
18
18
|
|
19
|
-
describe
|
19
|
+
describe "#fetch_required?" do
|
20
20
|
|
21
21
|
context "when the repository is not cloned" do
|
22
22
|
before { allow(subject).to receive(:cloned?).and_return(false) }
|
@@ -47,7 +47,7 @@ module Omnibus
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
describe
|
50
|
+
describe "#version_guid" do
|
51
51
|
let(:revision) { "abcd1234" }
|
52
52
|
|
53
53
|
before do
|
@@ -59,7 +59,7 @@ module Omnibus
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
describe
|
62
|
+
describe "#clean" do
|
63
63
|
before do
|
64
64
|
allow(subject).to receive(:git)
|
65
65
|
allow(subject).to receive(:resolved_version).and_return("12341235")
|
@@ -80,7 +80,7 @@ module Omnibus
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe
|
83
|
+
describe "#fetch" do
|
84
84
|
before do
|
85
85
|
allow(subject).to receive(:create_required_directories)
|
86
86
|
end
|
@@ -118,7 +118,7 @@ module Omnibus
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
-
describe
|
121
|
+
describe "#version_for_cache" do
|
122
122
|
it "returns the shasum of the commit that we expect to be at" do
|
123
123
|
expect(subject.version_for_cache).to eq("revision:123abcd1234")
|
124
124
|
end
|
@@ -25,7 +25,7 @@ module Omnibus
|
|
25
25
|
|
26
26
|
subject { described_class.new(manifest_entry, project_dir, build_dir) }
|
27
27
|
|
28
|
-
describe
|
28
|
+
describe "#fetch_required?" do
|
29
29
|
context "when file is not downloaded" do
|
30
30
|
before { allow(File).to receive(:exist?).and_return(false) }
|
31
31
|
|
@@ -61,7 +61,7 @@ module Omnibus
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
describe
|
64
|
+
describe "#version_guid" do
|
65
65
|
context "source with md5" do
|
66
66
|
it "returns the shasum" do
|
67
67
|
expect(subject.version_guid).to eq("md5:abcd1234")
|
@@ -99,7 +99,7 @@ module Omnibus
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
describe
|
102
|
+
describe "#clean" do
|
103
103
|
before do
|
104
104
|
allow(FileUtils).to receive(:rm_rf)
|
105
105
|
allow(subject).to receive(:deploy)
|
@@ -138,7 +138,7 @@ module Omnibus
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
|
-
describe
|
141
|
+
describe "#version_for_cache" do
|
142
142
|
context "source with md5" do
|
143
143
|
it "returns the download URL and md5" do
|
144
144
|
expect(subject.version_for_cache).to eq("download_url:https://get.example.com/file.tar.gz|md5:abcd1234")
|
@@ -176,6 +176,46 @@ module Omnibus
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
+
describe "#download_url" do
|
180
|
+
context "s3 cache enabled" do
|
181
|
+
before do
|
182
|
+
Config.use_s3_caching(true)
|
183
|
+
Config.s3_access_key("ABCD1234")
|
184
|
+
Config.s3_secret_key("EFGH5678")
|
185
|
+
Config.s3_bucket("mybucket")
|
186
|
+
|
187
|
+
# clear cache
|
188
|
+
S3Cache.remove_instance_variable(:@s3_client) if S3Cache.instance_variable_defined?(:@s3_client)
|
189
|
+
end
|
190
|
+
|
191
|
+
it "returns the source s3 generated url" do
|
192
|
+
expect(subject.send(:download_url)).to eq("https://mybucket.s3.amazonaws.com/file-1.2.3-abcd1234")
|
193
|
+
end
|
194
|
+
|
195
|
+
context "custom endpoint" do
|
196
|
+
before { Config.s3_endpoint("http://example.com") }
|
197
|
+
|
198
|
+
it "returns the url using custom s3 endpoint" do
|
199
|
+
expect(subject.send(:download_url)).to eq("http://mybucket.example.com/file-1.2.3-abcd1234")
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
context "s3 transfer acceleration" do
|
204
|
+
before { Config.s3_accelerate(true) }
|
205
|
+
|
206
|
+
it "returns the url using s3 accelerate endpoint" do
|
207
|
+
expect(subject.send(:download_url)).to eq("https://mybucket.s3-accelerate.amazonaws.com/file-1.2.3-abcd1234")
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
context "s3 cache disabled" do
|
213
|
+
it "returns the source url" do
|
214
|
+
expect(subject.send(:download_url)).to eq("https://get.example.com/file.tar.gz")
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
179
219
|
describe "downloading the file" do
|
180
220
|
|
181
221
|
let(:expected_open_opts) do
|
@@ -274,7 +314,7 @@ module Omnibus
|
|
274
314
|
end
|
275
315
|
end
|
276
316
|
|
277
|
-
describe
|
317
|
+
describe "#deploy" do
|
278
318
|
before do
|
279
319
|
described_class.send(:public, :deploy)
|
280
320
|
end
|
@@ -322,7 +362,7 @@ module Omnibus
|
|
322
362
|
end
|
323
363
|
end
|
324
364
|
|
325
|
-
describe
|
365
|
+
describe "#extract" do
|
326
366
|
|
327
367
|
context "on Windows" do
|
328
368
|
let(:root_prefix) { "C:" }
|
@@ -16,7 +16,7 @@ module Omnibus
|
|
16
16
|
|
17
17
|
subject { described_class.new(manifest_entry, project_dir, build_dir) }
|
18
18
|
|
19
|
-
describe
|
19
|
+
describe "#fetch_required?" do
|
20
20
|
context "when the SHAs match" do
|
21
21
|
before do
|
22
22
|
allow(subject).to receive(:target_shasum).and_return("abcd1234")
|
@@ -40,19 +40,19 @@ module Omnibus
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
describe
|
43
|
+
describe "#version_guid" do
|
44
44
|
it "returns the path" do
|
45
45
|
expect(subject.version_guid).to eq("path:#{source_path}")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
describe
|
49
|
+
describe "#clean" do
|
50
50
|
it "returns true" do
|
51
51
|
expect(subject.clean).to be_truthy
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
describe
|
55
|
+
describe "#fetch" do
|
56
56
|
before do
|
57
57
|
allow(subject).to receive(:create_required_directories)
|
58
58
|
allow(FileSyncer).to receive(:sync)
|
@@ -64,7 +64,7 @@ module Omnibus
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
describe
|
67
|
+
describe "#version_for_cache" do
|
68
68
|
let(:shasum) { "abcd1234" }
|
69
69
|
|
70
70
|
before do
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "omnibus/file_syncer"
|
3
|
+
|
4
|
+
module Omnibus
|
5
|
+
describe FileSyncer do
|
6
|
+
let(:fixture_dir) { "C:\\test" }
|
7
|
+
|
8
|
+
describe "#glob", :windows_only do
|
9
|
+
|
10
|
+
[ "/", "\\", "\\\\" ].each do |sep|
|
11
|
+
it "should correctly clean the path with #{sep}" do
|
12
|
+
pattern = fixture_dir + sep + "postinstall"
|
13
|
+
expect(Dir).to receive(:glob).with("C:/test/postinstall", File::FNM_DOTMATCH).and_return(["C:/test/postinstall"])
|
14
|
+
FileSyncer.glob(pattern)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/spec/unit/git_cache_spec.rb
CHANGED
@@ -52,13 +52,15 @@ module Omnibus
|
|
52
52
|
described_class.new(zlib)
|
53
53
|
end
|
54
54
|
|
55
|
-
|
55
|
+
let(:git_flags) { %Q{-c core.autocrlf=false -c core.ignorecase=false --git-dir="#{cache_path}" --work-tree="#{install_dir}"} }
|
56
|
+
|
57
|
+
describe "#cache_path" do
|
56
58
|
it "returns the install path appended to the install_cache path" do
|
57
59
|
expect(ipc.cache_path).to eq(cache_path)
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
61
|
-
describe
|
63
|
+
describe "#tag" do
|
62
64
|
it "returns the correct tag" do
|
63
65
|
expect(ipc.tag).to eql("zlib-24a8ec71da04059dcf7ed3c6e8e0fd9d155476abe4b5156d1f13c42e85478c2b-#{cache_serial_number}")
|
64
66
|
end
|
@@ -74,7 +76,7 @@ module Omnibus
|
|
74
76
|
end
|
75
77
|
end
|
76
78
|
|
77
|
-
describe
|
79
|
+
describe "#create_cache_path" do
|
78
80
|
it "runs git init if the cache path does not exist" do
|
79
81
|
allow(File).to receive(:directory?)
|
80
82
|
.with(ipc.cache_path)
|
@@ -85,7 +87,11 @@ module Omnibus
|
|
85
87
|
expect(FileUtils).to receive(:mkdir_p)
|
86
88
|
.with(File.dirname(ipc.cache_path))
|
87
89
|
expect(ipc).to receive(:shellout!)
|
88
|
-
.with("git
|
90
|
+
.with("git #{git_flags} init -q")
|
91
|
+
expect(ipc).to receive(:shellout!)
|
92
|
+
.with("git #{git_flags} config --local user.name \"Omnibus Git Cache\"")
|
93
|
+
expect(ipc).to receive(:shellout!)
|
94
|
+
.with("git #{git_flags} config --local user.email \"omnibus@localhost\"")
|
89
95
|
ipc.create_cache_path
|
90
96
|
end
|
91
97
|
|
@@ -101,7 +107,7 @@ module Omnibus
|
|
101
107
|
end
|
102
108
|
end
|
103
109
|
|
104
|
-
describe
|
110
|
+
describe "#incremental" do
|
105
111
|
before(:each) do
|
106
112
|
allow(ipc).to receive(:shellout!)
|
107
113
|
allow(ipc).to receive(:create_cache_path)
|
@@ -115,24 +121,24 @@ module Omnibus
|
|
115
121
|
it "adds all the changes to git removing git directories" do
|
116
122
|
expect(ipc).to receive(:remove_git_dirs)
|
117
123
|
expect(ipc).to receive(:shellout!)
|
118
|
-
.with("git
|
124
|
+
.with("git #{git_flags} add -A -f")
|
119
125
|
ipc.incremental
|
120
126
|
end
|
121
127
|
|
122
128
|
it "commits the backup for the software" do
|
123
129
|
expect(ipc).to receive(:shellout!)
|
124
|
-
.with(%Q{git
|
130
|
+
.with(%Q{git #{git_flags} commit -q -m "Backup of #{ipc.tag}"})
|
125
131
|
ipc.incremental
|
126
132
|
end
|
127
133
|
|
128
134
|
it "tags the software backup" do
|
129
135
|
expect(ipc).to receive(:shellout!)
|
130
|
-
.with(%Q{git
|
136
|
+
.with(%Q{git #{git_flags} tag -f "#{ipc.tag}"})
|
131
137
|
ipc.incremental
|
132
138
|
end
|
133
139
|
end
|
134
140
|
|
135
|
-
describe
|
141
|
+
describe "#remove_git_dirs" do
|
136
142
|
let(:git_files) { ["git/HEAD", "git/description", "git/hooks", "git/info", "git/objects", "git/refs" ] }
|
137
143
|
it "removes bare git directories" do
|
138
144
|
allow(Dir).to receive(:glob).and_return(["git/config"])
|
@@ -155,7 +161,7 @@ module Omnibus
|
|
155
161
|
end
|
156
162
|
end
|
157
163
|
|
158
|
-
describe
|
164
|
+
describe "#restore" do
|
159
165
|
let(:git_tag_output) { "#{ipc.tag}\n" }
|
160
166
|
|
161
167
|
let(:tag_cmd) do
|
@@ -167,10 +173,10 @@ module Omnibus
|
|
167
173
|
|
168
174
|
before(:each) do
|
169
175
|
allow(ipc).to receive(:shellout!)
|
170
|
-
.with(%Q{git
|
176
|
+
.with(%Q{git #{git_flags} tag -l "#{ipc.tag}"})
|
171
177
|
.and_return(tag_cmd)
|
172
178
|
allow(ipc).to receive(:shellout!)
|
173
|
-
.with(%Q{git
|
179
|
+
.with(%Q{git #{git_flags} tag -f restore_here "#{ipc.tag}"})
|
174
180
|
allow(ipc).to receive(:create_cache_path)
|
175
181
|
end
|
176
182
|
|
@@ -179,26 +185,74 @@ module Omnibus
|
|
179
185
|
ipc.restore
|
180
186
|
end
|
181
187
|
|
182
|
-
it "checks for a tag with the software and version, and if it finds it,
|
188
|
+
it "checks for a tag with the software and version, and if it finds it, marks it as restoration point" do
|
183
189
|
expect(ipc).to receive(:shellout!)
|
184
|
-
.with(%Q{git
|
190
|
+
.with(%Q{git #{git_flags} tag -l "#{ipc.tag}"})
|
185
191
|
.and_return(tag_cmd)
|
186
192
|
expect(ipc).to receive(:shellout!)
|
187
|
-
.with(%Q{git
|
193
|
+
.with(%Q{git #{git_flags} tag -f restore_here "#{ipc.tag}"})
|
188
194
|
ipc.restore
|
189
195
|
end
|
190
196
|
|
191
197
|
describe "if the tag does not exist" do
|
192
198
|
let(:git_tag_output) { "\n" }
|
199
|
+
let(:restore_tag_cmd) do
|
200
|
+
cmd_double = double(Mixlib::ShellOut)
|
201
|
+
allow(cmd_double).to receive(:stdout).and_return(git_restore_tag_output)
|
202
|
+
allow(cmd_double).to receive(:error!).and_return(cmd_double)
|
203
|
+
cmd_double
|
204
|
+
end
|
193
205
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
206
|
+
describe "if the restore marker tag exists" do
|
207
|
+
let(:git_restore_tag_output) { "restore_here\n" }
|
208
|
+
|
209
|
+
it "checks out the last save restoration point and deletes the marker tag" do
|
210
|
+
expect(ipc).to receive(:shellout!)
|
211
|
+
.with(%Q{git #{git_flags} tag -l "restore_here"})
|
212
|
+
.and_return(restore_tag_cmd)
|
213
|
+
expect(ipc).to receive(:shellout!)
|
214
|
+
.with(%Q{git #{git_flags} tag -l "#{ipc.tag}"})
|
215
|
+
.and_return(tag_cmd)
|
216
|
+
expect(ipc).to receive(:shellout!)
|
217
|
+
.with(%Q{git #{git_flags} checkout -f restore_here})
|
218
|
+
expect(ipc).to receive(:shellout!)
|
219
|
+
.with(%Q{git #{git_flags} tag -d restore_here})
|
220
|
+
ipc.restore
|
221
|
+
end
|
201
222
|
end
|
223
|
+
|
224
|
+
describe "if the restore marker tag does not exist" do
|
225
|
+
let(:git_restore_tag_output) { "\n" }
|
226
|
+
|
227
|
+
it "does nothing" do
|
228
|
+
expect(ipc).to receive(:shellout!)
|
229
|
+
.with(%Q{git #{git_flags} tag -l "restore_here"})
|
230
|
+
.and_return(restore_tag_cmd)
|
231
|
+
expect(ipc).to receive(:shellout!)
|
232
|
+
.with(%Q{git #{git_flags} tag -l "#{ipc.tag}"})
|
233
|
+
.and_return(tag_cmd)
|
234
|
+
ipc.restore
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
describe "#git_cmd" do
|
241
|
+
let(:terrible_install_dir) { %q{/opt/why please don't do this} }
|
242
|
+
|
243
|
+
before(:each) do
|
244
|
+
allow(project).to receive(:install_dir)
|
245
|
+
.and_return(terrible_install_dir)
|
246
|
+
allow(ipc).to receive(:shellout!)
|
247
|
+
.with(%Q{git #{git_flags} version})
|
248
|
+
.and_return("git version 2.11.0")
|
249
|
+
end
|
250
|
+
|
251
|
+
it "doesn't mangle an #install_dir with spaces" do
|
252
|
+
expect(ipc.send(:install_dir)).to eq(terrible_install_dir)
|
253
|
+
expect(ipc).to receive(:shellout!)
|
254
|
+
.with(%Q{git #{git_flags} version})
|
255
|
+
ipc.send(:git_cmd, "version")
|
202
256
|
end
|
203
257
|
end
|
204
258
|
end
|
@@ -139,7 +139,7 @@ module Omnibus
|
|
139
139
|
)
|
140
140
|
end
|
141
141
|
|
142
|
-
let(:regexp) { ".*(\\.[ch]|\\.e*rb|\\.gemspec|\\.gitignore|\\.h*h|\\.java|\\.js|\\.json|\\.lock|\\.log|\\.lua|\\.md|\\.mkd|\\.out|\\.pl|\\.pm|\\.png|\\.py[oc]*|\\.r*html|\\.rdoc|\\.ri|\\.sh|\\.sql|\\.toml|\\.ttf|\\.txt|\\.xml|\\.yml|Gemfile|LICENSE|README|Rakefile|VERSION)$|.*\\/share\\/doc\\/.*|.*\\/share\\/postgresql\\/.*|.*\\/share\\/terminfo\\/.*|.*\\/terminfo\\/.*" }
|
142
|
+
let(:regexp) { ".*(\\.TXT|\\.[ch]|\\.[ch]pp|\\.[eh]rl|\\.app|\\.appup|\\.bat|\\.beam|\\.cc|\\.cmake|\\.conf|\\.css|\\.e*rb|\\.feature|\\.gemspec|\\.gif|\\.gitignore|\\.gitkeep|\\.h*h|\\.jar|\\.java|\\.jpg|\\.js|\\.jsm|\\.json|\\.lock|\\.log|\\.lua|\\.md|\\.mkd|\\.npmignore|\\.out|\\.packlist|\\.perl|\\.pl|\\.pm|\\.png|\\.pod|\\.properties|\\.py[oc]*|\\.r*html|\\.rake|\\.rdoc|\\.ri|\\.rst|\\.scss|\\.sh|\\.sql|\\.svg|\\.toml|\\.ttf|\\.txt|\\.xml|\\.yml|Gemfile|LICENSE|Makefile|README|Rakefile|VERSION|license)$|.*\\/build_info\\/.*|.*\\/licenses\\/.*|.*\\/LICENSES\\/.*|.*\\/man\\/.*|.*\\/share\\/doc\\/.*|.*\\/share\\/info\\/.*|.*\\/share\\/postgresql\\/.*|.*\\/share\\/terminfo\\/.*|.*\\/share\\/timezone\\/.*|.*\\/terminfo\\/.*" }
|
143
143
|
|
144
144
|
it "raises an exception when there are external dependencies" do
|
145
145
|
allow(subject).to receive(:shellout)
|