bosh-workspace 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bosh-workspace.gemspec +5 -4
- data/lib/bosh/cli/commands/deployment_patch.rb +0 -1
- data/lib/bosh/cli/commands/prepare.rb +12 -11
- data/lib/bosh/workspace.rb +4 -3
- data/lib/bosh/workspace/credentials.rb +12 -5
- data/lib/bosh/workspace/git_credentials_provider.rb +80 -0
- data/lib/bosh/workspace/{git_remote_url.rb → helpers/git_protocol_helper.rb} +4 -8
- data/lib/bosh/workspace/helpers/project_deployment_helper.rb +10 -2
- data/lib/bosh/workspace/helpers/release_helper.rb +33 -7
- data/lib/bosh/workspace/manifest_builder.rb +6 -8
- data/lib/bosh/workspace/merge_tool.rb +73 -0
- data/lib/bosh/workspace/project_deployment.rb +20 -5
- data/lib/bosh/workspace/release.rb +103 -67
- data/lib/bosh/workspace/schemas/credentials.rb +22 -0
- data/lib/bosh/workspace/schemas/project_deployment.rb +14 -1
- data/lib/bosh/workspace/version.rb +1 -1
- data/spec/assets/bin/spruce +0 -0
- data/spec/assets/manifests-repo/deployments/foo.yml +1 -0
- data/spec/assets/manifests-repo/stubs/foo.yml +4 -0
- data/spec/commands/prepare_spec.rb +39 -12
- data/spec/credentials_spec.rb +8 -0
- data/spec/git_credentials_provider_spec.rb +82 -0
- data/spec/{git_remote_url_spec.rb → helpers/git_protocol_helper_spec.rb} +10 -11
- data/spec/helpers/project_deployment_helper_spec.rb +12 -1
- data/spec/helpers/release_helper_spec.rb +157 -73
- data/spec/manifest_builder_spec.rb +6 -5
- data/spec/merge_tool_spec.rb +98 -0
- data/spec/project_deployment_spec.rb +43 -1
- data/spec/release_spec.rb +369 -354
- data/spec/rugged_spec.rb +64 -0
- data/spec/schemas/credentials_spec.rb +22 -5
- data/spec/spec_helper.rb +1 -0
- metadata +35 -15
- data/lib/bosh/workspace/helpers/git_credentials_helper.rb +0 -111
- data/lib/bosh/workspace/helpers/spiff_helper.rb +0 -34
- data/spec/helpers/git_credentials_helper_spec.rb +0 -190
- data/spec/helpers/spiff_helper_spec.rb +0 -68
@@ -1,68 +0,0 @@
|
|
1
|
-
describe Bosh::Workspace::SpiffHelper do
|
2
|
-
describe ".spiff" do
|
3
|
-
class SpiffHelperTester
|
4
|
-
include Bosh::Workspace::SpiffHelper
|
5
|
-
end
|
6
|
-
subject { SpiffHelperTester.new }
|
7
|
-
let(:path) { asset_dir("bin") }
|
8
|
-
let(:templates) { ["foo.yml", "bar.yml"] }
|
9
|
-
let(:target_file) { "spiffed_manifest.yml" }
|
10
|
-
let(:args) { [/spiff merge/, Hash] }
|
11
|
-
|
12
|
-
around do |example|
|
13
|
-
original_path = ENV["PATH"]
|
14
|
-
ENV["PATH"] = path
|
15
|
-
example.run
|
16
|
-
ENV["PATH"] = original_path
|
17
|
-
end
|
18
|
-
|
19
|
-
before do
|
20
|
-
expect(subject).to receive(:sh).with(*args).and_yield(result)
|
21
|
-
end
|
22
|
-
|
23
|
-
context "spiff not in path" do
|
24
|
-
let(:path) { asset_dir("empty_bin") }
|
25
|
-
let(:result) { Bosh::Exec::Result.new("spiff", "", 0, true) }
|
26
|
-
|
27
|
-
it "raises an error" do
|
28
|
-
expect{ subject.spiff_merge templates, target_file }
|
29
|
-
.to raise_error /make sure spiff is installed/
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
context "spiff error" do
|
34
|
-
let(:path) { asset_dir("empty_bin") }
|
35
|
-
let(:result) { Bosh::Exec::Result.new("spiff", "spiff error", 1, false) }
|
36
|
-
|
37
|
-
it "raises an error" do
|
38
|
-
expect(subject).to receive(:say).with(/Command failed/)
|
39
|
-
expect{ subject.spiff_merge templates, target_file }
|
40
|
-
.to raise_error /spiff error/
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe ".spiff_merge" do
|
45
|
-
let(:file) { instance_double("File") }
|
46
|
-
let(:output) { "---\n{}" }
|
47
|
-
let(:result) { Bosh::Exec::Result.new("spiff", output, 0, false) }
|
48
|
-
|
49
|
-
before do
|
50
|
-
expect(File).to receive(:open).with(target_file, 'w').and_yield(file)
|
51
|
-
expect(file).to receive(:write).with(output)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "merges manifests" do
|
55
|
-
subject.spiff_merge templates, target_file
|
56
|
-
end
|
57
|
-
|
58
|
-
context "spaces in template paths" do
|
59
|
-
let(:templates) { ["space test/foo space test.yml"] }
|
60
|
-
let(:args) { [/space\\ test\/foo\\ space\\ test.yml/, Hash] }
|
61
|
-
|
62
|
-
it "merges manifests" do
|
63
|
-
subject.spiff_merge templates, target_file
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|