capistrano-ndenv 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +1 -0
- data/capistrano-ndenv.gemspec +21 -0
- data/lib/capistrano-rbenv.rb +0 -0
- data/lib/capistrano/ndenv.rb +1 -0
- data/lib/capistrano/tasks/ndenv.rake +49 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1949cdcd9963d99b12105f42d1aa7297ddec2f3b
|
4
|
+
data.tar.gz: a2ab9d7a0b02f052dfd8388785fea6b43e1be2fb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 12c99e598f7217ec67d4ad67f553af6de0fd2f82277202d4eeb882706ba43b451b932015d69f41ce2e0b5f30e90ddbea06b3c96390fc47acab653fe7dfd60ef7
|
7
|
+
data.tar.gz: a727188bb0b79d804f83d5f824f4eb8f648f49fa59082470d6a73093e9cce9c5916fde5a55713b30e9392c14820f06851849801fa121992b37086497fc661858
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013-2014 Kir Shatrov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Capistrano::ndenv
|
2
|
+
|
3
|
+
This gem provides idiomatic ndenv support for Capistrano 3.x (and 3.x *only*).
|
4
|
+
|
5
|
+
*NOTE*: This gem is a rip-off of https://github.com/capistrano/rbenv - give them the credit.
|
6
|
+
|
7
|
+
# Why you might want it?
|
8
|
+
|
9
|
+
If you need to execute node or npm from capistrano and you prefer ndenv over nvm
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'capistrano', '~> 3.1'
|
16
|
+
gem 'capistrano-ndenv', '~> 1.0'
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle install
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
# Capfile
|
25
|
+
require 'capistrano/ndenv'
|
26
|
+
|
27
|
+
|
28
|
+
# config/deploy.rb
|
29
|
+
set :ndenv_type, :user # or :system, depends on your ndenv setup
|
30
|
+
set :ndenv_node, 'v0.10.31'
|
31
|
+
set :ndenv_prefix, "NDENV_ROOT=#{fetch(:ndenv_path)} NDENV_VERSION=#{fetch(:ndenv_node)} #{fetch(:ndenv_path)}/bin/ndenv exec"
|
32
|
+
set :ndenv_map_bins, %w{npm node} # default
|
33
|
+
set :ndenv_roles, :all # default value
|
34
|
+
|
35
|
+
If your ndenv is located in some custom path, you can use `ndenv_custom_path` to set it.
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
|
39
|
+
1. Fork it
|
40
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
41
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
42
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
43
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = "capistrano-ndenv"
|
7
|
+
gem.version = '1.0.0'
|
8
|
+
gem.authors = ["Shaun Guth"]
|
9
|
+
gem.email = ["shaun.guth@gmail.com"]
|
10
|
+
gem.description = %q{ndenv integration for Capistrano}
|
11
|
+
gem.summary = %q{This gem lets you use ndenv for node/npm integration in Capistrano}
|
12
|
+
gem.homepage = "https://github.com/l8nite/capistrano-ndenv"
|
13
|
+
gem.licenses = ['MIT']
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
|
19
|
+
gem.add_dependency 'capistrano', '~> 3.1'
|
20
|
+
gem.add_dependency 'sshkit', '~> 1.3'
|
21
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/ndenv.rake", __FILE__)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
namespace :ndenv do
|
2
|
+
task :validate do
|
3
|
+
on release_roles(fetch(:ndenv_roles)) do
|
4
|
+
ndenv_node = fetch(:ndenv_node)
|
5
|
+
if ndenv_node.nil?
|
6
|
+
error "ndenv: ndenv_node is not set"
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
10
|
+
unless test "[ -d #{fetch(:ndenv_node_dir)} ]"
|
11
|
+
error "ndenv: #{ndenv_node} is not installed or not found in #{fetch(:ndenv_node_dir)}"
|
12
|
+
exit 1
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
task :map_bins do
|
18
|
+
SSHKit.config.default_env.merge!({ ndenv_root: fetch(:ndenv_path), ndenv_version: fetch(:ndenv_node) })
|
19
|
+
ndenv_prefix = fetch(:ndenv_prefix, proc { "#{fetch(:ndenv_path)}/bin/ndenv exec" })
|
20
|
+
SSHKit.config.command_map[:ndenv] = "#{fetch(:ndenv_path)}/bin/ndenv"
|
21
|
+
|
22
|
+
fetch(:ndenv_map_bins).each do |command|
|
23
|
+
SSHKit.config.command_map.prefix[command.to_sym].unshift(ndenv_prefix)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Capistrano::DSL.stages.each do |stage|
|
29
|
+
after stage, 'ndenv:validate'
|
30
|
+
after stage, 'ndenv:map_bins'
|
31
|
+
end
|
32
|
+
|
33
|
+
namespace :load do
|
34
|
+
task :defaults do
|
35
|
+
set :ndenv_path, -> {
|
36
|
+
ndenv_path = fetch(:ndenv_custom_path)
|
37
|
+
ndenv_path ||= if fetch(:ndenv_type, :user) == :system
|
38
|
+
"/usr/local/ndenv"
|
39
|
+
else
|
40
|
+
"~/.ndenv"
|
41
|
+
end
|
42
|
+
}
|
43
|
+
|
44
|
+
set :ndenv_roles, fetch(:ndenv_roles, :all)
|
45
|
+
|
46
|
+
set :ndenv_node_dir, -> { "#{fetch(:ndenv_path)}/versions/#{fetch(:ndenv_node)}" }
|
47
|
+
set :ndenv_map_bins, %w{npm node}
|
48
|
+
end
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-ndenv
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shaun Guth
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::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'
|
41
|
+
description: ndenv integration for Capistrano
|
42
|
+
email:
|
43
|
+
- shaun.guth@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- CHANGELOG.md
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- capistrano-ndenv.gemspec
|
55
|
+
- lib/capistrano-rbenv.rb
|
56
|
+
- lib/capistrano/ndenv.rb
|
57
|
+
- lib/capistrano/tasks/ndenv.rake
|
58
|
+
homepage: https://github.com/l8nite/capistrano-ndenv
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.2.2
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: This gem lets you use ndenv for node/npm integration in Capistrano
|
82
|
+
test_files: []
|