vx-builder 0.5.60 → 0.5.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 844421cc9984d1f8585cc4e9d910d8b584dea3b9
4
- data.tar.gz: d75f133b2548c4b6a440271e0c810e6b9c69f12f
3
+ metadata.gz: 76650145ebc75debb2b2ac541e2ee3997a72e844
4
+ data.tar.gz: 31eddffa0f442106ddcca5c6b7b50403e5b02dcb
5
5
  SHA512:
6
- metadata.gz: 1590ec881a64403884258e8d67cdaaa24c9c25c3872f5350f13d452e1bbc301877c59fc6d9f696648388cbb3f6b402d7f5d072ebe9fc6372b36f150e21bb3cdc
7
- data.tar.gz: 07e709814d992ad8682df55cb107bf4444e65a6778fa08760c6d1c2cba1541f9a075a0fe79912a6de34eef993e0133300b263143c1544a750a0aa6c3fd7b1310
6
+ metadata.gz: 6022f3b6f5746d4e0afb6786d25f4f273a02b4a5bb66d8f601a922994000bed474d7881c56c71518341245a96f42d0fd0151af2cbb944c406767a67024a6a474
7
+ data.tar.gz: ada9d2c483b2722c013bd65b5c42c1e02b558ccb86a944804d4b4290d4ba6e93f7323977d78ac084ebcf376ee42b4ae31659863d5d6735ead8f72c3c38d592ad
@@ -17,13 +17,14 @@ module Vx
17
17
 
18
18
  env.stage("install").tap do |i|
19
19
  i.add_env 'GOPATH', '${HOME}/gopath:${GOPATH}'
20
- i.add_env 'PATH', '${HOME}/gopath/bin:${PATH}'
20
+ i.add_env 'PATH', '${HOME}/gopath/bin:${PATH}'
21
21
  i.add_env 'VX_ORIG_CODE_ROOT', '${PWD}'
22
- i.add_env "VX_NEW_CODE_ROOT", "${HOME}/gopath/src/#{project_path env}"
22
+ i.add_env "VX_NEW_CODE_ROOT", "${HOME}/gopath/src/#{project_path env}"
23
23
 
24
24
  i.add_task 'shell', 'mkdir -p $VX_NEW_CODE_ROOT'
25
25
  i.add_task 'shell', 'rmdir $VX_NEW_CODE_ROOT'
26
26
  i.add_task 'shell', 'cp -r $VX_ORIG_CODE_ROOT $VX_NEW_CODE_ROOT'
27
+ i.add_task 'shell', "sudo chown -R ${USER}:${USER} ${GOROOT}"
27
28
  i.add_task 'chdir', '${VX_NEW_CODE_ROOT}'
28
29
 
29
30
  i.add_task 'shell', 'go version'
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Builder
3
- VERSION = "0.5.60"
3
+ VERSION = "0.5.61"
4
4
  end
5
5
  end
@@ -47,7 +47,7 @@ describe "(integration v2) go" do
47
47
  io.write "set -e\n"
48
48
  io.write b.script.to_script
49
49
  end
50
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
50
+ system("env", "-", "USER=#{ENV['USER']}", "HOME=#{path}", "bash", "script.sh" )
51
51
  expect($?.to_i).to eq 0
52
52
  end
53
53
  end
data/vx-builder.gemspec CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'vx-common', '0.4.0'
22
- spec.add_runtime_dependency 'vx-message'
21
+ spec.add_runtime_dependency 'vx-common', '0.4.0'
22
+ spec.add_runtime_dependency 'vx-message', '0.6.2'
23
23
  spec.add_runtime_dependency 'hashr'
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.60
4
+ version: 0.5.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: vx-message
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.6.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.6.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hashr
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -215,12 +215,6 @@ files:
215
215
  - spec/fixtures/travis_bug_2.yml
216
216
  - spec/fixtures/vx_test_repo_insecure_key
217
217
  - spec/fixtures/vx_test_repo_insecure_key.pub
218
- - spec/integration/clojure_spec.rb
219
- - spec/integration/go_spec.rb
220
- - spec/integration/nodejs_spec.rb
221
- - spec/integration/python_spec.rb
222
- - spec/integration/ruby_spec.rb
223
- - spec/integration/rust_spec.rb
224
218
  - spec/integration/script_builder_v2/clojure_spec.rb
225
219
  - spec/integration/script_builder_v2/go_spec.rb
226
220
  - spec/integration/script_builder_v2/nodejs_spec.rb
@@ -312,12 +306,6 @@ test_files:
312
306
  - spec/fixtures/travis_bug_2.yml
313
307
  - spec/fixtures/vx_test_repo_insecure_key
314
308
  - spec/fixtures/vx_test_repo_insecure_key.pub
315
- - spec/integration/clojure_spec.rb
316
- - spec/integration/go_spec.rb
317
- - spec/integration/nodejs_spec.rb
318
- - spec/integration/python_spec.rb
319
- - spec/integration/ruby_spec.rb
320
- - spec/integration/rust_spec.rb
321
309
  - spec/integration/script_builder_v2/clojure_spec.rb
322
310
  - spec/integration/script_builder_v2/go_spec.rb
323
311
  - spec/integration/script_builder_v2/nodejs_spec.rb
@@ -1,42 +0,0 @@
1
- require 'spec_helper'
2
- require 'yaml'
3
- require 'tmpdir'
4
- require 'fileutils'
5
-
6
- describe "(integration) go" do
7
- let(:path) { Dir.tmpdir + "/vx-builder-test" }
8
-
9
- before do
10
- FileUtils.rm_rf(path)
11
- FileUtils.mkdir_p(path)
12
- end
13
- after { FileUtils.rm_rf(path) }
14
-
15
- def build(file, options = {})
16
- config = Vx::Builder::BuildConfiguration.from_yaml(file)
17
- matrix = Vx::Builder.matrix config
18
- options[:task] ||= create(:task)
19
- script = Vx::Builder.script(options[:task], matrix.build.first)
20
- OpenStruct.new script: script, matrix: matrix
21
- end
22
-
23
- it "should succesfuly run lang/clojure", real: true do
24
- file = {"language" => "clojure"}.to_yaml
25
- task = create(
26
- :task,
27
- sha: "HEAD",
28
- branch: "lang/clojure"
29
- )
30
-
31
- b = build(file, task: task)
32
- Dir.chdir(path) do
33
- File.open("script.sh", "w") do |io|
34
- io.write "set -e\n"
35
- io.write b.script.to_before_script
36
- io.write b.script.to_script
37
- end
38
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
39
- expect($?.to_i).to eq 0
40
- end
41
- end
42
- end
@@ -1,70 +0,0 @@
1
- require 'spec_helper'
2
- require 'yaml'
3
- require 'tmpdir'
4
- require 'fileutils'
5
-
6
- describe "(integration) go" do
7
- let(:path) { Dir.tmpdir + "/vx-builder-test" }
8
-
9
- before do
10
- FileUtils.rm_rf(path)
11
- FileUtils.mkdir_p(path)
12
- end
13
- after { FileUtils.rm_rf(path) }
14
-
15
- def write_script_to_filter(prefix, script)
16
- File.open(fixture_path("integration/go/#{prefix}before_script.sh"), 'w') do |io|
17
- io << script.to_before_script
18
- end
19
- File.open(fixture_path("integration/go/#{prefix}after_script.sh"), 'w') do |io|
20
- io << script.to_after_script
21
- end
22
- File.open(fixture_path("integration/go/#{prefix}script.sh"), 'w') do |io|
23
- io << script.to_script
24
- end
25
- end
26
-
27
- def build(file, options = {})
28
- config = Vx::Builder::BuildConfiguration.from_yaml(file)
29
- matrix = Vx::Builder.matrix config
30
- options[:task] ||= create(:task)
31
- script = Vx::Builder.script(options[:task], matrix.build.first)
32
- OpenStruct.new script: script, matrix: matrix
33
- end
34
-
35
- context "(generation)" do
36
- let(:file) { fixture("integration/go/language/config.yml") }
37
- let(:b) { build(file) }
38
- before { write_script_to_filter "language/", b.script }
39
-
40
- it "should generate one configuration" do
41
- expect(b.matrix.build).to have(1).item
42
- end
43
-
44
- it "should generate valid scripts" do
45
- expect(b.script.to_before_script).to eq fixture("integration/go/language/before_script.sh")
46
- expect(b.script.to_script).to eq fixture("integration/go/language/script.sh")
47
- expect(b.script.to_after_script).to eq fixture("integration/go/language/after_script.sh")
48
- end
49
- end
50
-
51
- it "should succesfuly run lang/go", real: true do
52
- file = {"language" => "go"}.to_yaml
53
- task = create(
54
- :task,
55
- sha: "HEAD",
56
- branch: "lang/go"
57
- )
58
-
59
- b = build(file, task: task)
60
- Dir.chdir(path) do
61
- File.open("script.sh", "w") do |io|
62
- io.write "set -e\n"
63
- io.write b.script.to_before_script
64
- io.write b.script.to_script
65
- end
66
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
67
- expect($?.to_i).to eq 0
68
- end
69
- end
70
- end
@@ -1,65 +0,0 @@
1
- require 'spec_helper'
2
- require 'yaml'
3
- require 'tmpdir'
4
- require 'fileutils'
5
-
6
- describe "(integration) nodejs" do
7
- let(:path) { Dir.tmpdir + "/vx-builder-test" }
8
-
9
- before do
10
- FileUtils.rm_rf(path)
11
- FileUtils.mkdir_p(path)
12
- end
13
- after { FileUtils.rm_rf(path) }
14
-
15
- def build(file, options = {})
16
- config = Vx::Builder::BuildConfiguration.from_yaml(file)
17
- matrix = Vx::Builder.matrix config
18
- options[:task] ||= create(:task)
19
- script = Vx::Builder.script(options[:task], matrix.build.first)
20
- OpenStruct.new script: script, matrix: matrix
21
- end
22
-
23
- it "should succesfuly run lang/nodejs", real: true do
24
- file = {"language" => "node_js"}.to_yaml
25
- task = create(
26
- :task,
27
- sha: "HEAD",
28
- branch: "lang/nodejs"
29
- )
30
-
31
- b = build(file, task: task)
32
- Dir.chdir(path) do
33
- File.open("script.sh", "w") do |io|
34
- io.write "set -e\n"
35
- io.write b.script.to_before_script
36
- io.write b.script.to_script
37
- end
38
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
39
- expect($?.to_i).to eq 0
40
- end
41
- end
42
-
43
- it "should succesfuly run lang/nodejs witn npm", real: true do
44
- file = {
45
- "language" => "node_js",
46
- 'before_script' => "npm install -g bower",
47
- 'script' => 'bower --version' }.to_yaml
48
- task = create(
49
- :task,
50
- sha: "HEAD",
51
- branch: "lang/nodejs"
52
- )
53
-
54
- b = build(file, task: task)
55
- Dir.chdir(path) do
56
- File.open("script.sh", "w") do |io|
57
- io.write "set -e\n"
58
- io.write b.script.to_before_script
59
- io.write b.script.to_script
60
- end
61
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
62
- expect($?.to_i).to eq 0
63
- end
64
- end
65
- end
@@ -1,44 +0,0 @@
1
- require 'spec_helper'
2
- require 'yaml'
3
- require 'tmpdir'
4
- require 'fileutils'
5
-
6
- describe "(integration) python" do
7
- let(:path) { Dir.tmpdir + "/vx-builder-test" }
8
-
9
- before do
10
- FileUtils.rm_rf(path)
11
- FileUtils.mkdir_p(path)
12
- end
13
- after do
14
- system "sudo rm -rf #{path}"
15
- end
16
-
17
- def build(file, options = {})
18
- config = Vx::Builder::BuildConfiguration.from_yaml(file)
19
- matrix = Vx::Builder.matrix config
20
- options[:task] ||= create(:task)
21
- script = Vx::Builder.script(options[:task], matrix.build.first)
22
- OpenStruct.new script: script, matrix: matrix
23
- end
24
-
25
- it "should succesfuly run lang/python", real: true do
26
- file = {"language" => "python"}.to_yaml
27
- task = create(
28
- :task,
29
- sha: "HEAD",
30
- branch: "lang/python"
31
- )
32
-
33
- b = build(file, task: task)
34
- Dir.chdir(path) do
35
- File.open("script.sh", "w") do |io|
36
- io.write "set -e\n"
37
- io.write b.script.to_before_script
38
- io.write b.script.to_script
39
- end
40
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
41
- expect($?.to_i).to eq 0
42
- end
43
- end
44
- end
@@ -1,195 +0,0 @@
1
- require 'spec_helper'
2
- require 'fileutils'
3
- require 'tempfile'
4
- require 'yaml'
5
-
6
- describe "(integration) ruby" do
7
- let(:path) { Dir.tmpdir + "/vx-builder-test" }
8
-
9
- before do
10
- FileUtils.rm_rf(path)
11
- FileUtils.mkdir_p(path)
12
- end
13
-
14
- after { FileUtils.rm_rf(path) }
15
-
16
- def write_script_to_filter(prefix, script)
17
- File.open(fixture_path("integration/ruby/#{prefix}before_script.sh"), 'w') do |io|
18
- io << script.to_before_script
19
- end
20
- File.open(fixture_path("integration/ruby/#{prefix}after_script.sh"), 'w') do |io|
21
- io << script.to_after_script
22
- end
23
- File.open(fixture_path("integration/ruby/#{prefix}script.sh"), 'w') do |io|
24
- io << script.to_script
25
- end
26
- end
27
-
28
- def build(file, options = {})
29
- config = file ? Vx::Builder::BuildConfiguration.from_yaml(file) : Vx::Builder::BuildConfiguration.new(nil)
30
- matrix = Vx::Builder.matrix config
31
- options[:task] ||= create(:task)
32
- rs = OpenStruct.new matrix: matrix, scripts: []
33
- matrix.build.each do |b|
34
- rs.scripts << Vx::Builder.script(options[:task], b)
35
- end
36
- rs
37
- end
38
-
39
- context "generation" do
40
- let(:config) { fixture("integration/ruby/language/config.yml") }
41
-
42
- it "should successfuly generate scripts using language: ruby" do
43
- c = fixture("integration/ruby/language/config.yml")
44
- b = build(c)
45
- expect(b.scripts).to have(1).item
46
- script = b.scripts[0]
47
- write_script_to_filter("language/", script)
48
- expect(script.to_before_script).to eq fixture("integration/ruby/language/before_script.sh")
49
- expect(script.to_script).to eq fixture("integration/ruby/language/script.sh")
50
- expect(script.to_after_script).to eq fixture("integration/ruby/language/after_script.sh")
51
- end
52
-
53
- it "should successfuly generate scripts for deploy" do
54
- c = fixture("integration/ruby/deploy/config.yml")
55
- b = build(c)
56
- expect(b.scripts).to have(1).item
57
- script = b.scripts[0]
58
- write_script_to_filter("deploy/", script)
59
- expect(script.to_before_script).to eq fixture("integration/ruby/deploy/before_script.sh")
60
- expect(script.to_script).to eq fixture("integration/ruby/deploy/script.sh")
61
- expect(script.to_after_script).to eq fixture("integration/ruby/deploy/after_script.sh")
62
- end
63
-
64
- it "should successfuly generate scripts for rvm matrix" do
65
- c = fixture("integration/ruby/matrix/config.yml")
66
- b = build(c)
67
-
68
- expect(b.scripts).to have(2).items
69
-
70
- script = b.scripts[0]
71
- write_script_to_filter("matrix/0.", script)
72
-
73
- expect(script.to_before_script).to eq fixture("integration/ruby/matrix/0.before_script.sh")
74
- expect(script.to_script).to eq fixture("integration/ruby/matrix/0.script.sh")
75
- expect(script.to_after_script).to eq fixture("integration/ruby/matrix/0.after_script.sh")
76
-
77
- script = b.scripts[1]
78
- write_script_to_filter("matrix/1.", script)
79
-
80
- expect(script.to_before_script).to eq fixture("integration/ruby/matrix/1.before_script.sh")
81
- expect(script.to_script).to eq fixture("integration/ruby/matrix/1.script.sh")
82
- expect(script.to_after_script).to eq fixture("integration/ruby/matrix/1.after_script.sh")
83
-
84
- deploy = Vx::Builder.deploy(b.matrix, branch: "master").build
85
- expect(deploy).to have(1).item
86
-
87
- script = Vx::Builder.script(create(:task), deploy[0])
88
- write_script_to_filter("matrix/d.", script)
89
-
90
- expect(script.to_before_script).to eq fixture("integration/ruby/matrix/d.before_script.sh")
91
- expect(script.to_script).to eq fixture("integration/ruby/matrix/d.script.sh")
92
- expect(script.to_after_script).to eq fixture("integration/ruby/matrix/d.after_script.sh")
93
- end
94
- end
95
-
96
- it "should succesfuly run lang/ruby", real: true do
97
- file = {"language" => "ruby"}.to_yaml
98
- task = create(
99
- :task,
100
- sha: "HEAD",
101
- branch: "lang/ruby"
102
- )
103
-
104
- b = build(file, task: task)
105
- Dir.chdir(path) do
106
- File.open("script.sh", "w") do |io|
107
- io.write "set -e\n"
108
- io.write b.scripts[0].to_before_script
109
- io.write b.scripts[0].to_script
110
- end
111
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
112
- expect($?.to_i).to eq 0
113
- end
114
- end
115
-
116
- it "should succesfuly run lang/ruby with rvm key", real: true do
117
- file = {"rvm" => "2.1"}.to_yaml
118
- task = create(
119
- :task,
120
- sha: "HEAD",
121
- branch: "lang/ruby"
122
- )
123
-
124
- b = build(file, task: task)
125
- Dir.chdir(path) do
126
- File.open("script.sh", "w") do |io|
127
- io.write "set -e\n"
128
- io.write b.scripts[0].to_before_script
129
- io.write b.scripts[0].to_script
130
- end
131
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
132
- expect($?.to_i).to eq 0
133
- end
134
- end
135
-
136
- it "should succesfuly run lang/ruby with parallel_rspec", real: true do
137
- file = {"language" => "ruby", "parallel" => 3, "script" => "parallel_rspec"}.to_yaml
138
- task = create(
139
- :task,
140
- sha: "HEAD",
141
- branch: "lang/ruby"
142
- )
143
-
144
- b = build(file, task: task)
145
- Dir.chdir(path) do
146
- File.open("script.sh", "w") do |io|
147
- io.write "set -e\n"
148
- io.write b.scripts[0].to_before_script
149
- io.write b.scripts[0].to_script
150
- end
151
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
152
- expect($?.to_i).to eq 0
153
- end
154
- end
155
-
156
- it "should succesfuly run lang/ruby-rails-pg", real: true do
157
- file = {"language" => "ruby"}.to_yaml
158
- task = create(
159
- :task,
160
- sha: "HEAD",
161
- branch: "lang/ruby-rails-pg"
162
- )
163
-
164
- b = build(file, task: task)
165
- Dir.chdir(path) do
166
- File.open("script.sh", "w") do |io|
167
- io.write "set -e\n"
168
- io.write b.scripts[0].to_before_script
169
- io.write b.scripts[0].to_script
170
- end
171
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
172
- expect($?.to_i).to eq 0
173
- end
174
- end
175
-
176
- it "should succesfuly run lang/ruby-rails-mysql", real: true do
177
- file = {"language" => "ruby"}.to_yaml
178
- task = create(
179
- :task,
180
- sha: "HEAD",
181
- branch: "lang/ruby-rails-mysql"
182
- )
183
-
184
- b = build(file, task: task)
185
- Dir.chdir(path) do
186
- File.open("script.sh", "w") do |io|
187
- io.write "set -e\n"
188
- io.write b.scripts[0].to_before_script
189
- io.write b.scripts[0].to_script
190
- end
191
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
192
- expect($?.to_i).to eq 0
193
- end
194
- end
195
- end
@@ -1,42 +0,0 @@
1
- require 'spec_helper'
2
- require 'yaml'
3
- require 'tmpdir'
4
- require 'fileutils'
5
-
6
- describe "(integration) rust" do
7
- let(:path) { Dir.tmpdir + "/vx-builder-test" }
8
-
9
- before do
10
- FileUtils.rm_rf(path)
11
- FileUtils.mkdir_p(path)
12
- end
13
- after { FileUtils.rm_rf(path) }
14
-
15
- def build(file, options = {})
16
- config = Vx::Builder::BuildConfiguration.from_yaml(file)
17
- matrix = Vx::Builder.matrix config
18
- options[:task] ||= create(:task)
19
- script = Vx::Builder.script(options[:task], matrix.build.first)
20
- OpenStruct.new script: script, matrix: matrix
21
- end
22
-
23
- it "should succesfuly run lang/rust", real: true do
24
- file = {"language" => "rust"}.to_yaml
25
- task = create(
26
- :task,
27
- sha: "HEAD",
28
- branch: "lang/rust"
29
- )
30
-
31
- b = build(file, task: task)
32
- Dir.chdir(path) do
33
- File.open("script.sh", "w") do |io|
34
- io.write "set -e\n"
35
- io.write b.script.to_before_script
36
- io.write b.script.to_script
37
- end
38
- system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
39
- expect($?.to_i).to eq 0
40
- end
41
- end
42
- end