vx-builder 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e67f84ce5b95530309ebe1ccb2c723720e42386
4
- data.tar.gz: 75ae8db2b1b290a0eb24e777d1c2990c31bd71a1
3
+ metadata.gz: ed4202898a00a69bd2f499a568f8caec71977d66
4
+ data.tar.gz: 992ff2819ab8e68872fbde5c5c14d78cfe360505
5
5
  SHA512:
6
- metadata.gz: ac49d58aebaaaca74ce52a6aa14069f487f4cd6b049e3a6b1c339d8136b772cb29ce769f0aaab68387796069a0ea457630a0b9bbc9b90175353df03735052d71
7
- data.tar.gz: 7cdc31ce08d174614b8950107d6c6709ef250c91e5966bb8eb0f95548fd83cde9fad0e24bc970dfc77bb7ed24f5ccaa25fd646fe9b05f46cf204e48f14d3cb02
6
+ metadata.gz: a7c911962c18960fc2b26a07ba3fdbc338a5970527cc8eb833f0837874b305374d7f7fb19e53f2ddc6b6dbf46096d4e970595fed22a36b6a6c0b3a5923acd9b9
7
+ data.tar.gz: 34eb9d1f94e16abab9ac897ed67729ff2385e7bdfd90073241a342662ed6b0ad3aba1f6c7092e26b494241edf3006f8dcf56efdfd4487ac43d7cb22d8456c275
@@ -15,6 +15,7 @@ module Vx
15
15
  go
16
16
  language
17
17
  script
18
+ node_js
18
19
  }
19
20
 
20
21
  ATTRIBUTES = %w{
@@ -22,6 +23,7 @@ module Vx
22
23
  scala
23
24
  jdk
24
25
  go
26
+ node_js
25
27
  language
26
28
 
27
29
  gemfile
@@ -8,6 +8,7 @@ module Vx
8
8
  scala
9
9
  jdk
10
10
  go
11
+ node_js
11
12
 
12
13
  image
13
14
  env_matrix:env
@@ -0,0 +1,48 @@
1
+ module Vx
2
+ module Builder
3
+ class ScriptBuilder
4
+
5
+ class Nodejs < Base
6
+
7
+ DEFAULT_NODE = '0.10'
8
+
9
+ def call(env)
10
+ if enabled?(env)
11
+
12
+ vxvm_install(env, 'nodejs', node_version(env))
13
+
14
+ do_cache_key(env) do |i|
15
+ i << "nodejs-#{node_version env}"
16
+ end
17
+
18
+ do_announce(env) do |i|
19
+ i << trace_sh_command("node --version")
20
+ i << trace_sh_command("npm --version")
21
+ end
22
+
23
+ do_install(env) do |i|
24
+ i << trace_sh_command("npm install")
25
+ end
26
+
27
+ do_script(env) do |i|
28
+ i << trace_sh_command("npm test")
29
+ end
30
+ end
31
+
32
+ app.call(env)
33
+ end
34
+
35
+ private
36
+
37
+ def enabled?(env)
38
+ env.source.node_js.first || env.source.language == 'node_js'
39
+ end
40
+
41
+ def node_version(env)
42
+ env.source.node_js.first || DEFAULT_NODE
43
+ end
44
+
45
+ end
46
+ end
47
+ end
48
+ end
@@ -8,6 +8,7 @@ module Vx
8
8
  autoload :Env, File.expand_path("../script_builder/env", __FILE__)
9
9
  autoload :Ruby, File.expand_path("../script_builder/ruby", __FILE__)
10
10
  autoload :Go, File.expand_path("../script_builder/go", __FILE__)
11
+ autoload :Nodejs, File.expand_path("../script_builder/nodejs", __FILE__)
11
12
  autoload :Java, File.expand_path("../script_builder/java", __FILE__)
12
13
  autoload :Scala, File.expand_path("../script_builder/scala", __FILE__)
13
14
  autoload :Clojure, File.expand_path("../script_builder/clojure", __FILE__)
@@ -33,6 +34,7 @@ module Vx
33
34
  use Builder::ScriptBuilder::Clojure
34
35
  use Builder::ScriptBuilder::Ruby
35
36
  use Builder::ScriptBuilder::Go
37
+ use Builder::ScriptBuilder::Nodejs
36
38
 
37
39
  use Builder::ScriptBuilder::Deploy
38
40
  use Builder::ScriptBuilder::Defaults
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Builder
3
- VERSION = "0.5.2"
3
+ VERSION = "0.5.3"
4
4
  end
5
5
  end
@@ -38,6 +38,7 @@ chmod +x $VX_ROOT/bin/vxvm
38
38
  export CASHER_DIR=$HOME/.casher && ( mkdir -p $CASHER_DIR/bin && /usr/bin/curl https://raw2.github.com/dima-exe/casher/master/bin/casher --tcp-nodelay --retry 3 --fail --silent --show-error -o $HOME/.casher/bin/casher && chmod +x $HOME/.casher/bin/casher ) || true
39
39
  test -f $HOME/.casher/bin/casher && casher-ruby $HOME/.casher/bin/casher fetch http://example.com/test/pull-request/rvm-1.9.3-gemfile.tgz http://example.com/master/rvm-1.9.3-gemfile.tgz || true
40
40
  test -f $HOME/.casher/bin/casher && casher-ruby $HOME/.casher/bin/casher add ~/.rubygems || true
41
+ test -f $HOME/.casher/bin/casher && casher-ruby $HOME/.casher/bin/casher add ~/.rubygems || true
41
42
  unset CASHER_DIR
42
43
 
43
44
  # before install
@@ -20,6 +20,8 @@ jdk: "openjdk7"
20
20
 
21
21
  go: '1.2.2'
22
22
 
23
+ node_js: "0.10"
24
+
23
25
  image:
24
26
  - one
25
27
  - two
@@ -0,0 +1,42 @@
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/go", 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
+ end
@@ -41,6 +41,7 @@ describe Vx::Builder::BuildConfiguration do
41
41
  "jdk" => ['openjdk7'],
42
42
  "language" => ["ruby"],
43
43
  "go" => ['1.2.2'],
44
+ "node_js" => ['0.10'],
44
45
  "rvm" => ["2.0.0"],
45
46
  "scala" => ['2.10.3'],
46
47
  "script" => ["RAILS_ENV=test ls -1 && echo DONE!"],
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.5.2
4
+ version: 0.5.3
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-07-02 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vx-common
@@ -145,6 +145,7 @@ files:
145
145
  - lib/vx/builder/script_builder/env.rb
146
146
  - lib/vx/builder/script_builder/go.rb
147
147
  - lib/vx/builder/script_builder/java.rb
148
+ - lib/vx/builder/script_builder/nodejs.rb
148
149
  - lib/vx/builder/script_builder/prepare.rb
149
150
  - lib/vx/builder/script_builder/ruby.rb
150
151
  - lib/vx/builder/script_builder/scala.rb
@@ -184,6 +185,7 @@ files:
184
185
  - spec/fixtures/vx_test_repo_insecure_key.pub
185
186
  - spec/integration/clojure_spec.rb
186
187
  - spec/integration/go_spec.rb
188
+ - spec/integration/nodejs_spec.rb
187
189
  - spec/integration/ruby_spec.rb
188
190
  - spec/lib/builder/build_configuration/cache_spec.rb
189
191
  - spec/lib/builder/build_configuration/deploy/base_spec.rb
@@ -266,6 +268,7 @@ test_files:
266
268
  - spec/fixtures/vx_test_repo_insecure_key.pub
267
269
  - spec/integration/clojure_spec.rb
268
270
  - spec/integration/go_spec.rb
271
+ - spec/integration/nodejs_spec.rb
269
272
  - spec/integration/ruby_spec.rb
270
273
  - spec/lib/builder/build_configuration/cache_spec.rb
271
274
  - spec/lib/builder/build_configuration/deploy/base_spec.rb