capistrano-nodenv-install 1.0.0.pre.beta.2

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 53fa90ebfbcd03322ad2725bd39ebb5c8bf5f6ea
4
+ data.tar.gz: db74f49fe3bf33054cd1797ac12a6982525e0b0e
5
+ SHA512:
6
+ metadata.gz: ffd1501d09ef5bed8776cad852802657c85a42402a82a3b47af56bf9492fca24bb2ebf6de7bd06a9c862f3ca53944f5683bf4c9beb0681d7c28c64eef80deb94
7
+ data.tar.gz: 2ac50b7459aa1dddaa6c65c66eafb1f64257a1ddb1cfce89a5f1527f6890a490f738eba4b8f91f2498c9c9b03b2d32b5ef8ebc8c32a9d230cbbb878f6f48421f
@@ -0,0 +1,50 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
@@ -0,0 +1,12 @@
1
+ # Capistrano::Nodenv::Install Changelog
2
+
3
+ ### 1.0.0-beta.2
4
+
5
+ - Updated [Capistrano::nodenv](https://github.com/platanus/capistrano-nodenv) version
6
+ - Added gitignore to project
7
+
8
+ ### 1.0.0-beta.1
9
+
10
+ - Forked from [Capistrano::Rbenv::Install](https://github.com/capistrano-plugins/capistrano-rbenv-install)
11
+ - Renamed all references from `rbenv` to `nodenv`
12
+ - Updated LICENSE.txt to include this repository
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in *.gemspec
4
+ gemspec
@@ -0,0 +1,40 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-nodenv-install (1.0.0.pre.beta.2)
5
+ capistrano (~> 3.1)
6
+ capistrano-nodenv (~> 1.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ airbrussh (1.0.2)
12
+ sshkit (>= 1.6.1, != 1.7.0)
13
+ capistrano (3.5.0)
14
+ airbrussh (>= 1.0.0)
15
+ capistrano-harrow
16
+ i18n
17
+ rake (>= 10.0.0)
18
+ sshkit (>= 1.9.0)
19
+ capistrano-harrow (0.5.2)
20
+ capistrano-nodenv (1.1.0)
21
+ capistrano (~> 3.1)
22
+ sshkit (~> 1.3)
23
+ i18n (0.7.0)
24
+ net-scp (1.2.1)
25
+ net-ssh (>= 2.6.5)
26
+ net-ssh (3.2.0)
27
+ rake (11.2.2)
28
+ sshkit (1.11.1)
29
+ net-scp (>= 1.1.2)
30
+ net-ssh (>= 2.8.0)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ capistrano-nodenv-install!
37
+ rake
38
+
39
+ BUNDLED WITH
40
+ 1.12.5
@@ -0,0 +1,39 @@
1
+ Copyright (C) 2016 Steve Jabour
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the
8
+ Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included
11
+ in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
18
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
19
+ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+
21
+ Copyright (C) 2014 Bruno Sutic
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining
24
+ a copy of this software and associated documentation files (the "Software"),
25
+ to deal in the Software without restriction, including without limitation
26
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
27
+ and/or sell copies of the Software, and to permit persons to whom the
28
+ Software is furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included
31
+ in all copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
36
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
37
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
38
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
39
+ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,102 @@
1
+ # Capistrano::Nodenv::Install
2
+
3
+ Capistrano plugin for **lightweight** nodes management with nodenv.
4
+
5
+ Works with Capistrano 3 (only).
6
+
7
+ ### Installation
8
+
9
+ Install by adding the following to the `Gemfile`:
10
+
11
+ gem 'capistrano', '~> 3.2.1'
12
+ gem 'capistrano-nodenv', '~> 1.0' # required
13
+ gem 'capistrano-nodenv-install', '~> 1.0'
14
+
15
+ then:
16
+
17
+ $ bundle install
18
+
19
+ ### Configuration and usage
20
+
21
+ The following goes to `Capfile`:
22
+
23
+ require 'capistrano/nodenv_install'
24
+
25
+ This plugin heavily relies on
26
+ [capistrano-nodenv config options](https://github.com/atsjj/capistrano-nodenv#usage).
27
+ So make sure to properly setup `capistrano-nodenv` and you'll be good.
28
+
29
+ For example, in `config/deploy.rb`:
30
+
31
+ set :nodenv_node, '6.3.0'
32
+
33
+ Other than that, this plugin does not need any setup.
34
+
35
+ Run:
36
+
37
+ $ bundle exec cap production deploy
38
+
39
+ And watch node being installed.
40
+
41
+ ### Purpose
42
+
43
+ Installing software packages on servers is called
44
+ [provisioning](http://en.wikipedia.org/wiki/Provisioning#Server_provisioning).
45
+ Installing and managing nodes falls into that domain, and is best done with a
46
+ proper tool like chef, puppet, ansible or something else.
47
+
48
+ Why this plugin then?
49
+
50
+ - Capistrano is a great tool that makes deployments easy so, when there's a
51
+ need, installing nodes with it should be easy too
52
+ - not everyone knows (or has time to learn) how to use provisioning tools
53
+ mentioned above
54
+ - sometimes installing node manually is just easier than fiddling with your
55
+ chef cookbooks. Instead of manually, you can do it with this plugin now
56
+
57
+ Imagine you want to quickly deploy a node `5.0.0` app to a server that already
58
+ has one or more node `6.0.0` apps.
59
+ "Oh, let's just quickly update our cookbooks" - yea right! I'd rather manually
60
+ `ssh` to the server directly and run `nodenv install 5.0.0`. But I don't
61
+ want to manually `ssh` to the server too. In that case I just can install
62
+ `capistrano-nodenv-install` and forget about it altogether.
63
+
64
+ ### What it does
65
+
66
+ It only does the bare minimum that's required for Capistrano to work. That's
67
+ why it's a plugin for *lightweight* node management.
68
+
69
+ It makes sure that:
70
+
71
+ - `nodenv` and `node build` are installed (installs them using `git`)
72
+ - node specified with `:nodenv_node` option is installed
73
+
74
+ ### What it does NOT do
75
+
76
+ It **does not**:
77
+
78
+ - manage npm packages
79
+
80
+ - does not install node dependency packages<br/>
81
+ (git-core build-essential libreadline6-dev etc ...). You should probably
82
+ install/provision those some other way.
83
+
84
+ - does not manage `nodenv` plugins<br/>
85
+ It only installs `node build` for the purpose of installing node.
86
+
87
+ - does not setup nodenv for direct use on the server via the command line<br/>
88
+ Example: `ssh`ing to the server and manually running node commands is not
89
+ supported.
90
+
91
+ ### More Capistrano automation?
92
+
93
+ Check out [capistrano-plugins](https://github.com/capistrano-plugins) github org.
94
+
95
+ ### Thanks
96
+
97
+ The authors of [Capistrano::Rbenv::Install](https://github.com/capistrano-plugins/capistrano-rbenv-install)
98
+ This would not have been possible without your original work!
99
+
100
+ ### License
101
+
102
+ [MIT](LICENSE.txt)
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,23 @@
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-nodenv-install'
7
+ gem.version = '1.0.0-beta.2'
8
+ gem.authors = ['Steve Jabour']
9
+ gem.email = ['steve@jabour.me']
10
+ gem.description = %q{Capistrano plugin for lightweight nodes management with nodenv}
11
+ gem.summary = %q{Capistrano plugin for lightweight nodes management with nodenv}
12
+ gem.homepage = 'https://github.com/capistrano-plugins/capistrano-nodenv-install'
13
+ gem.license = '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 'capistrano-nodenv', '~> 1.1'
21
+
22
+ gem.add_development_dependency 'rake'
23
+ end
File without changes
@@ -0,0 +1,21 @@
1
+ module Capistrano
2
+ module DSL
3
+ module NodenvInstall
4
+ def nodenv_node_build_path
5
+ "#{fetch(:nodenv_path)}/plugins/node-build"
6
+ end
7
+
8
+ def nodenv_bin_executable_path
9
+ "#{fetch(:nodenv_path)}/bin/nodenv"
10
+ end
11
+
12
+ def nodenv_repo_url
13
+ 'https://github.com/nodenv/nodenv.git'
14
+ end
15
+
16
+ def node_build_repo_url
17
+ 'https://github.com/nodenv/node-build.git'
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path("../tasks/nodenv_install.rake", __FILE__)
@@ -0,0 +1,58 @@
1
+ require 'capistrano/dsl/nodenv_install'
2
+
3
+ include Capistrano::DSL::NodenvInstall
4
+
5
+ # Heavily depends on 'capistrano-nodenv' variables:
6
+ # https://github.com/capistrano/nodenv/blob/master/lib/capistrano/tasks/nodenv.rake#L33-49
7
+ # set :nodenv_type # :user or :system
8
+ # set :nodenv_node, '6.3.0' # node version
9
+ # set :nodenv_roles, :all # where nodenv should be installed
10
+ # set :nodenv_path, # ~/.nodenv or /usr/local/nodenv, depends on :nodenv_type
11
+ # set :nodenv_node_dir # "#{fetch(:nodenv_path)}/versions/#{fetch(:nodenv_node)}" }
12
+
13
+ namespace :nodenv do
14
+ desc 'Install nodenv'
15
+ task :install_nodenv do
16
+ on roles fetch(:nodenv_roles) do
17
+ next if test "[ -d #{fetch(:nodenv_path)} ]"
18
+ execute :git, :clone, nodenv_repo_url, fetch(:nodenv_path)
19
+ end
20
+ end
21
+
22
+ desc 'Install node build - nodenv plugin'
23
+ task :install_node_build do
24
+ on roles fetch(:nodenv_roles) do
25
+ next if test "[ -d #{nodenv_node_build_path} ]"
26
+ execute :git, :clone, node_build_repo_url, nodenv_node_build_path
27
+ end
28
+ end
29
+
30
+ desc 'Update node build - nodenv plugin'
31
+ task :update_node_build do
32
+ on roles fetch(:nodenv_roles) do
33
+ next unless test "[ -d #{nodenv_node_build_path} ]"
34
+ within nodenv_node_build_path do
35
+ execute :git, :pull
36
+ end
37
+ end
38
+ end
39
+
40
+ desc 'Install node'
41
+ task :install_node do
42
+ on roles fetch(:nodenv_roles) do
43
+ next if test "[ -d #{fetch(:nodenv_node_dir)} ]"
44
+ invoke 'nodenv:update_node_build'
45
+ execute nodenv_bin_executable_path, :install, fetch(:nodenv_node)
46
+ end
47
+ end
48
+
49
+ desc 'Install nodenv, node build and node version'
50
+ task :install do
51
+ invoke 'nodenv:install_nodenv'
52
+ invoke 'nodenv:install_node_build'
53
+ invoke 'nodenv:install_node'
54
+ end
55
+
56
+ before 'nodenv:validate', 'nodenv:install'
57
+ before 'bundler:map_bins', 'nodenv:install' if Rake::Task.task_defined?('bundler:map_bins')
58
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-nodenv-install
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.pre.beta.2
5
+ platform: ruby
6
+ authors:
7
+ - Steve Jabour
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-20 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: capistrano-nodenv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Capistrano plugin for lightweight nodes management with nodenv
56
+ email:
57
+ - steve@jabour.me
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - CHANGELOG.md
64
+ - Gemfile
65
+ - Gemfile.lock
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - capistrano-rbenv-install.gemspec
70
+ - lib/capistrano-nodenv-install.rb
71
+ - lib/capistrano/dsl/nodenv_install.rb
72
+ - lib/capistrano/nodenv_install.rb
73
+ - lib/capistrano/tasks/nodenv_install.rake
74
+ homepage: https://github.com/capistrano-plugins/capistrano-nodenv-install
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">"
90
+ - !ruby/object:Gem::Version
91
+ version: 1.3.1
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.6.4
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Capistrano plugin for lightweight nodes management with nodenv
98
+ test_files: []