capistrano-nodenv 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +17 -0
- data/CHANGELOG.md +3 -0
- data/README.md +5 -2
- data/capistrano-nodenv.gemspec +4 -4
- data/lib/capistrano/tasks/nodenv.rake +19 -18
- metadata +26 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aec274bb18a78c7dcaa8f2e08fb9e807293f7b32
|
4
|
+
data.tar.gz: 09aa30e24538e95eb5cbfa99f8d528a687026998
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a62d08c6a5f918ca5230dc70fee6a01c1d982c524b2b578be267e0bcbbe25d6128c08d3d78d84b2cda3bcbcfc8575f200fa63a586319a322c2b178fe7179c898
|
7
|
+
data.tar.gz: e3db5fc126f8f4abc96c897b7fa55749773fd196002ad87a6c44f5e88f617eb746cbc8e7cb63199af2000827c68c4c8106e75e4a839e6cac8d3d641a7912646d
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
|
5
5
|
Add this line to your application's Gemfile:
|
6
6
|
|
7
|
-
gem 'capistrano',
|
8
|
-
gem 'capistrano-nodenv',
|
7
|
+
gem 'capistrano', '~> 3.1'
|
8
|
+
gem 'capistrano-nodenv', '~> 1.0'
|
9
9
|
|
10
10
|
And then execute:
|
11
11
|
|
@@ -20,6 +20,9 @@ And then execute:
|
|
20
20
|
|
21
21
|
set :nodenv_type, :user # or :system, depends on your nodenv setup
|
22
22
|
set :nodenv_node, '0.10.3'
|
23
|
+
set :nodenv_prefix, "NODENV_ROOT=#{fetch(:nodenv_path)} NODENV_VERSION=#{fetch(:nodenv_ruby)} #{fetch(:nodenv_path)}/bin/nodenv exec"
|
24
|
+
set :nodenv_map_bins, %w{node npm}
|
25
|
+
set :nodenv_roles, :all # default value
|
23
26
|
|
24
27
|
If your nodenv is located in some custom path, you can use `nodenv_custom_path` to set it.
|
25
28
|
|
data/capistrano-nodenv.gemspec
CHANGED
@@ -4,17 +4,17 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "capistrano-nodenv"
|
7
|
-
gem.version = '0.0
|
7
|
+
gem.version = '1.0.0'
|
8
8
|
gem.authors = ["Juan Ignacio Donoso"]
|
9
9
|
gem.email = ["jidonoso@gmail.com"]
|
10
10
|
gem.description = %q{nodenv integration for Capistrano}
|
11
11
|
gem.summary = %q{nodenv integration for Capistrano}
|
12
|
-
gem.homepage = "https://github.com/capistrano
|
12
|
+
gem.homepage = "https://github.com/platanus/capistrano-nodenv"
|
13
13
|
|
14
14
|
gem.files = `git ls-files`.split($/)
|
15
15
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
|
-
gem.add_dependency 'capistrano'
|
19
|
-
|
18
|
+
gem.add_dependency 'capistrano', '~> 3.1'
|
19
|
+
gem.add_dependency 'sshkit', '~> 1.3'
|
20
20
|
end
|
@@ -1,21 +1,6 @@
|
|
1
|
-
SSHKit.config.command_map = Hash.new do |hash, key|
|
2
|
-
if fetch(:nodenv_map_bins).include?(key.to_s)
|
3
|
-
prefix = "NODENV_ROOT=#{fetch(:nodenv_path)} NODENV_VERSION=#{fetch(:nodenv_node)} #{fetch(:nodenv_path)}/bin/nodenv exec"
|
4
|
-
hash[key] = "#{prefix} #{key}"
|
5
|
-
else
|
6
|
-
hash[key] = key
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
namespace :deploy do
|
11
|
-
before :starting, :hook_nodenv_bins do
|
12
|
-
invoke :'nodenv:check'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
1
|
namespace :nodenv do
|
17
|
-
task :
|
18
|
-
on roles(:
|
2
|
+
task :validate do
|
3
|
+
on roles(fetch(:nodenv_roles)) do
|
19
4
|
nodenv_node = fetch(:nodenv_node)
|
20
5
|
if nodenv_node.nil?
|
21
6
|
error "nodenv: nodenv_node is not set"
|
@@ -28,11 +13,25 @@ namespace :nodenv do
|
|
28
13
|
end
|
29
14
|
end
|
30
15
|
end
|
16
|
+
|
17
|
+
task :map_bins do
|
18
|
+
SSHKit.config.default_env.merge!({ nodenv_root: fetch(:nodenv_path), nodenv_version: fetch(:nodenv_ruby) })
|
19
|
+
nodenv_prefix = fetch(:nodenv_prefix, proc { "#{fetch(:nodenv_path)}/bin/nodenv exec" })
|
20
|
+
SSHKit.config.command_map[:nodenv] = "#{fetch(:nodenv_path)}/bin/nodenv"
|
21
|
+
|
22
|
+
fetch(:nodenv_map_bins).each do |command|
|
23
|
+
SSHKit.config.command_map.prefix[command.to_sym].unshift(nodenv_prefix)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Capistrano::DSL.stages.each do |stage|
|
29
|
+
after stage, 'nodenv:validate'
|
30
|
+
after stage, 'nodenv:map_bins'
|
31
31
|
end
|
32
32
|
|
33
33
|
namespace :load do
|
34
34
|
task :defaults do
|
35
|
-
|
36
35
|
set :nodenv_path, -> {
|
37
36
|
nodenv_path = fetch(:nodenv_custom_path)
|
38
37
|
nodenv_path ||= if fetch(:nodenv_type, :user) == :system
|
@@ -42,6 +41,8 @@ namespace :load do
|
|
42
41
|
end
|
43
42
|
}
|
44
43
|
|
44
|
+
set :nodenv_roles, fetch(:nodenv_roles, :all)
|
45
|
+
|
45
46
|
set :nodenv_node_dir, -> { "#{fetch(:nodenv_path)}/versions/#{fetch(:nodenv_node)}" }
|
46
47
|
set :nodenv_map_bins, %w{node npm}
|
47
48
|
end
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-nodenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Ignacio Donoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sshkit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
27
41
|
description: nodenv integration for Capistrano
|
28
42
|
email:
|
29
43
|
- jidonoso@gmail.com
|
@@ -31,6 +45,8 @@ executables: []
|
|
31
45
|
extensions: []
|
32
46
|
extra_rdoc_files: []
|
33
47
|
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- CHANGELOG.md
|
34
50
|
- Gemfile
|
35
51
|
- README.md
|
36
52
|
- Rakefile
|
@@ -38,7 +54,7 @@ files:
|
|
38
54
|
- lib/capistrano-nodenv.rb
|
39
55
|
- lib/capistrano/nodenv.rb
|
40
56
|
- lib/capistrano/tasks/nodenv.rake
|
41
|
-
homepage: https://github.com/capistrano
|
57
|
+
homepage: https://github.com/platanus/capistrano-nodenv
|
42
58
|
licenses: []
|
43
59
|
metadata: {}
|
44
60
|
post_install_message:
|
@@ -47,17 +63,17 @@ require_paths:
|
|
47
63
|
- lib
|
48
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
49
65
|
requirements:
|
50
|
-
- -
|
66
|
+
- - ">="
|
51
67
|
- !ruby/object:Gem::Version
|
52
68
|
version: '0'
|
53
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
70
|
requirements:
|
55
|
-
- -
|
71
|
+
- - ">="
|
56
72
|
- !ruby/object:Gem::Version
|
57
73
|
version: '0'
|
58
74
|
requirements: []
|
59
75
|
rubyforge_project:
|
60
|
-
rubygems_version: 2.0.
|
76
|
+
rubygems_version: 2.0.14
|
61
77
|
signing_key:
|
62
78
|
specification_version: 4
|
63
79
|
summary: nodenv integration for Capistrano
|