vx-builder 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vx/builder/build_configuration/deploy/base.rb +4 -1
- data/lib/vx/builder/build_configuration.rb +6 -3
- data/lib/vx/builder/deploy_builder.rb +3 -2
- data/lib/vx/builder/version.rb +1 -1
- data/spec/integration/ruby_spec.rb +23 -18
- data/spec/lib/builder/build_configuration/deploy/base_spec.rb +1 -0
- data/spec/lib/builder/build_configuration_spec.rb +1 -0
- data/spec/lib/builder/deploy_builder_spec.rb +9 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7998b25a579c3f0454f0d8570e430a8160b277dd
|
4
|
+
data.tar.gz: 4db82b2386a234a21847bc238d246a7ee6a7b323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8092cff129181614b6c7508116de77fe34a48f52a8b09750b9958ceefb31a08710fe7255fcf5c205f3453af8e95db95e50f274130cdbab2be9c7e01be71eaea4
|
7
|
+
data.tar.gz: 84308df7403a76e3ba6da6782912dae15988a8c85a5ab76cc7f0392c4b36948c47ec6848ffcd83607035d8432734fb3cd6f2c6c4fa13b8385cb86e66af34ac48
|
@@ -84,9 +84,12 @@ module Vx
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def to_hash
|
87
|
-
attributes.merge(
|
88
|
-
|
89
|
-
|
87
|
+
attributes.merge(
|
88
|
+
"env" => env.attributes,
|
89
|
+
"cache" => cache.attributes,
|
90
|
+
"deploy" => deploy.attributes,
|
91
|
+
"deploy_modules" => deploy_modules.map(&:to_hash)
|
92
|
+
)
|
90
93
|
end
|
91
94
|
|
92
95
|
def to_yaml
|
@@ -20,7 +20,7 @@ module Vx
|
|
20
20
|
|
21
21
|
def build
|
22
22
|
@build ||= begin
|
23
|
-
return
|
23
|
+
return [] unless valid?
|
24
24
|
|
25
25
|
hash = matrix_build_configuration.to_hash
|
26
26
|
|
@@ -30,12 +30,13 @@ module Vx
|
|
30
30
|
|
31
31
|
hash["env"]["matrix"] = []
|
32
32
|
|
33
|
-
BuildConfiguration.new(
|
33
|
+
build_configuration = BuildConfiguration.new(
|
34
34
|
hash.merge(
|
35
35
|
"deploy_modules" => deploy_modules.map(&:to_hash),
|
36
36
|
"deploy" => nil
|
37
37
|
)
|
38
38
|
)
|
39
|
+
[build_configuration]
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
data/lib/vx/builder/version.rb
CHANGED
@@ -44,19 +44,22 @@ describe "(integration) ruby" do
|
|
44
44
|
let(:config) { fixture("integration/ruby/deploy/config.yml") }
|
45
45
|
|
46
46
|
context "configuration" do
|
47
|
-
let(:task)
|
48
|
-
let(:
|
49
|
-
subject { script }
|
50
|
-
|
51
|
-
before { write_script_to_filter "deploy/d." }
|
47
|
+
let(:task) { create :task, deploy: true }
|
48
|
+
let(:sources) { Vx::Builder.deploy(matrix, branch: "master").build }
|
52
49
|
|
53
50
|
it "should have source" do
|
54
|
-
expect(
|
51
|
+
expect(sources).to have(1).item
|
55
52
|
end
|
56
53
|
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
context "first deploy configuration" do
|
55
|
+
let(:source) { sources.first }
|
56
|
+
before { write_script_to_filter "deploy/d." }
|
57
|
+
subject { script }
|
58
|
+
|
59
|
+
its(:to_before_script) { should eq fixture("integration/ruby/deploy/d.before_script.sh") }
|
60
|
+
its(:to_script) { should eq fixture("integration/ruby/deploy/d.script.sh") }
|
61
|
+
its(:to_after_script) { should eq fixture("integration/ruby/deploy/d.after_script.sh") }
|
62
|
+
end
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
@@ -88,20 +91,22 @@ describe "(integration) ruby" do
|
|
88
91
|
end
|
89
92
|
|
90
93
|
context "deploy configuration" do
|
91
|
-
let(:task)
|
92
|
-
let(:
|
93
|
-
subject { script }
|
94
|
-
|
95
|
-
before { write_script_to_filter "matrix/d." }
|
94
|
+
let(:task) { create :task }
|
95
|
+
let(:sources) { Vx::Builder.deploy(matrix, branch: "master").build }
|
96
96
|
|
97
97
|
it "should have source" do
|
98
|
-
expect(
|
98
|
+
expect(sources).to have(1).item
|
99
99
|
end
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
context "first deploy configuration" do
|
102
|
+
let(:source) { sources.first }
|
103
|
+
subject { script }
|
104
|
+
before { write_script_to_filter "matrix/d." }
|
104
105
|
|
106
|
+
its(:to_before_script) { should eq fixture("integration/ruby/matrix/d.before_script.sh") }
|
107
|
+
its(:to_script) { should eq fixture("integration/ruby/matrix/d.script.sh") }
|
108
|
+
its(:to_after_script) { should eq fixture("integration/ruby/matrix/d.after_script.sh") }
|
109
|
+
end
|
105
110
|
end
|
106
111
|
end
|
107
112
|
end
|
@@ -44,6 +44,7 @@ describe Vx::Builder::BuildConfiguration do
|
|
44
44
|
"script" => ["RAILS_ENV=test ls -1 && echo DONE!"],
|
45
45
|
"services" => ['rabbitmq'],
|
46
46
|
"deploy" => [{"shell"=>"cap deploy production"}],
|
47
|
+
"deploy_modules" => [],
|
47
48
|
"bundler_args" => ["--without development"],
|
48
49
|
"before_deploy" => ["echo before deploy"],
|
49
50
|
"after_deploy" => ["echo after deploy"]
|
@@ -54,19 +54,20 @@ describe Vx::Builder::DeployBuilder do
|
|
54
54
|
|
55
55
|
context "build" do
|
56
56
|
|
57
|
-
it "should create
|
58
|
-
|
59
|
-
expect(
|
60
|
-
expect(
|
57
|
+
it "should create build_configurations with deploy_modules and without deploy" do
|
58
|
+
config = deploy.build
|
59
|
+
expect(config).to have(1).item
|
60
|
+
expect(config.first).to_not be_deploy
|
61
|
+
expect(config.first).to be_deploy_modules
|
61
62
|
end
|
62
63
|
|
63
|
-
it "should be
|
64
|
+
it "should be empty if not valid" do
|
64
65
|
deploy = described_class.new matrix, branch: "production"
|
65
|
-
expect(deploy.build).to
|
66
|
+
expect(deploy.build).to be_empty
|
66
67
|
end
|
67
68
|
|
68
69
|
it "should remove attributes from BLACK_LIST" do
|
69
|
-
config = deploy.build
|
70
|
+
config = deploy.build.first
|
70
71
|
expect(config.image).to be_empty
|
71
72
|
expect(config.before_script).to be_empty
|
72
73
|
expect(config.script).to be_empty
|
@@ -75,7 +76,7 @@ describe Vx::Builder::DeployBuilder do
|
|
75
76
|
end
|
76
77
|
|
77
78
|
it "should remove matrix env" do
|
78
|
-
config = deploy.build
|
79
|
+
config = deploy.build.first
|
79
80
|
expect(config.env.global).to eq(['1'])
|
80
81
|
expect(config.env.matrix).to eq([])
|
81
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vx-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vx-common
|