vx-builder 0.5.3 → 0.5.4

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: ed4202898a00a69bd2f499a568f8caec71977d66
4
- data.tar.gz: 992ff2819ab8e68872fbde5c5c14d78cfe360505
3
+ metadata.gz: c4de00411572ac7ab2b707e90b4aad89eb7cd4f1
4
+ data.tar.gz: 9c46eb763946c96bc5419ab6472404934ff2cf6a
5
5
  SHA512:
6
- metadata.gz: a7c911962c18960fc2b26a07ba3fdbc338a5970527cc8eb833f0837874b305374d7f7fb19e53f2ddc6b6dbf46096d4e970595fed22a36b6a6c0b3a5923acd9b9
7
- data.tar.gz: 34eb9d1f94e16abab9ac897ed67729ff2385e7bdfd90073241a342662ed6b0ad3aba1f6c7092e26b494241edf3006f8dcf56efdfd4487ac43d7cb22d8456c275
6
+ metadata.gz: 11681345019e7cdcaca8d653a555002f768170242921ae59b64d38df09e4c2b42cf56334dd41f96348fa5fcfe7aed391f9130898b333748956d89595e66648de
7
+ data.tar.gz: 9b1cfcf769202916faecec9270aea22df29fbbd302972d833abb525f36515bdf8a803119f424bff3837e1e2623e68d052046f2025281b9b8d80297c00d4fc210
@@ -13,9 +13,11 @@ module Vx
13
13
  scala
14
14
  jdk
15
15
  go
16
+ node_js
17
+ rust
18
+
16
19
  language
17
20
  script
18
- node_js
19
21
  }
20
22
 
21
23
  ATTRIBUTES = %w{
@@ -24,8 +26,9 @@ module Vx
24
26
  jdk
25
27
  go
26
28
  node_js
27
- language
29
+ rust
28
30
 
31
+ language
29
32
  gemfile
30
33
  services
31
34
  image
@@ -0,0 +1,48 @@
1
+ module Vx
2
+ module Builder
3
+ class ScriptBuilder
4
+
5
+ class Rust < Base
6
+
7
+ DEFAULT_RUST = '0.11.0'
8
+
9
+ def call(env)
10
+ if enabled?(env)
11
+
12
+ vxvm_install(env, 'rust', rust_version(env))
13
+
14
+ do_cache_key(env) do |i|
15
+ i << "rust-#{rust_version env}"
16
+ end
17
+
18
+ do_install(env) do |i|
19
+ i << trace_sh_command("git submodule init")
20
+ i << trace_sh_command("git submodule update")
21
+ end
22
+
23
+ do_announce(env) do |i|
24
+ i << trace_sh_command("rustc --version")
25
+ end
26
+
27
+ do_script(env) do |i|
28
+ i << trace_sh_command("if [ -f Makefile ] ; then make ; fi", trace: "make")
29
+ end
30
+ end
31
+
32
+ app.call(env)
33
+ end
34
+
35
+ private
36
+
37
+ def enabled?(env)
38
+ env.source.rust.first || env.source.language == 'rust'
39
+ end
40
+
41
+ def rust_version(env)
42
+ env.source.rust.first || DEFAULT_RUST
43
+ end
44
+
45
+ end
46
+ end
47
+ end
48
+ end
@@ -12,6 +12,7 @@ module Vx
12
12
  autoload :Java, File.expand_path("../script_builder/java", __FILE__)
13
13
  autoload :Scala, File.expand_path("../script_builder/scala", __FILE__)
14
14
  autoload :Clojure, File.expand_path("../script_builder/clojure", __FILE__)
15
+ autoload :Rust, File.expand_path("../script_builder/rust", __FILE__)
15
16
  autoload :Prepare, File.expand_path("../script_builder/prepare", __FILE__)
16
17
  autoload :Databases, File.expand_path("../script_builder/databases", __FILE__)
17
18
  autoload :Cache, File.expand_path("../script_builder/cache", __FILE__)
@@ -35,6 +36,7 @@ module Vx
35
36
  use Builder::ScriptBuilder::Ruby
36
37
  use Builder::ScriptBuilder::Go
37
38
  use Builder::ScriptBuilder::Nodejs
39
+ use Builder::ScriptBuilder::Rust
38
40
 
39
41
  use Builder::ScriptBuilder::Deploy
40
42
  use Builder::ScriptBuilder::Defaults
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Builder
3
- VERSION = "0.5.3"
3
+ VERSION = "0.5.4"
4
4
  end
5
5
  end
@@ -22,6 +22,8 @@ go: '1.2.2'
22
22
 
23
23
  node_js: "0.10"
24
24
 
25
+ rust: "0.11.0"
26
+
25
27
  image:
26
28
  - one
27
29
  - two
@@ -0,0 +1,42 @@
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
@@ -40,6 +40,7 @@ describe Vx::Builder::BuildConfiguration do
40
40
  "image" => ["one", "two"],
41
41
  "jdk" => ['openjdk7'],
42
42
  "language" => ["ruby"],
43
+ "rust" => ['0.11.0'],
43
44
  "go" => ['1.2.2'],
44
45
  "node_js" => ['0.10'],
45
46
  "rvm" => ["2.0.0"],
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.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
@@ -148,6 +148,7 @@ files:
148
148
  - lib/vx/builder/script_builder/nodejs.rb
149
149
  - lib/vx/builder/script_builder/prepare.rb
150
150
  - lib/vx/builder/script_builder/ruby.rb
151
+ - lib/vx/builder/script_builder/rust.rb
151
152
  - lib/vx/builder/script_builder/scala.rb
152
153
  - lib/vx/builder/script_builder/services.rb
153
154
  - lib/vx/builder/script_builder/timeouts.rb
@@ -187,6 +188,7 @@ files:
187
188
  - spec/integration/go_spec.rb
188
189
  - spec/integration/nodejs_spec.rb
189
190
  - spec/integration/ruby_spec.rb
191
+ - spec/integration/rust_spec.rb
190
192
  - spec/lib/builder/build_configuration/cache_spec.rb
191
193
  - spec/lib/builder/build_configuration/deploy/base_spec.rb
192
194
  - spec/lib/builder/build_configuration/deploy/shell_spec.rb
@@ -270,6 +272,7 @@ test_files:
270
272
  - spec/integration/go_spec.rb
271
273
  - spec/integration/nodejs_spec.rb
272
274
  - spec/integration/ruby_spec.rb
275
+ - spec/integration/rust_spec.rb
273
276
  - spec/lib/builder/build_configuration/cache_spec.rb
274
277
  - spec/lib/builder/build_configuration/deploy/base_spec.rb
275
278
  - spec/lib/builder/build_configuration/deploy/shell_spec.rb