capistrano_pm2 0.0.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.
- checksums.yaml +7 -0
- data/.gitignore +82 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +57 -0
- data/Rakefile +1 -0
- data/capistrano_pm2.gemspec +27 -0
- data/lib/capistrano/pm2.rb +1 -0
- data/lib/capistrano/tasks/pm2.rake +79 -0
- data/lib/capistrano_pm2.rb +5 -0
- data/lib/capistrano_pm2/version.rb +4 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 74e7c330366168d342d679774b635fd13cce4b3d
|
4
|
+
data.tar.gz: 57b0945944581db354bdfabcfa2f206a084bc34b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fb3bc46dbdec76e7bb9af7727540f079affac6ab6823deb193b853c4fd19ee38578e9c52c1d8216deddd0f999270ddc6165d7b7c84e8b7335d014dc7dcc523d0
|
7
|
+
data.tar.gz: a95ab8d16fb23db2b730b322ebfcd24f82a0e5711cebe30de4875cf5d33e23c2c782d080b992f786f0ac9dfc7c7c7f2a8532924b4b9cb9a715acf27a8a5b6c9a
|
data/.gitignore
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
*.bundle
|
11
|
+
*.so
|
12
|
+
*.o
|
13
|
+
*.a
|
14
|
+
mkmf.log
|
15
|
+
#### joe made this: https://goel.io/joe
|
16
|
+
|
17
|
+
#####=== Vim ===#####
|
18
|
+
[._]*.s[a-w][a-z]
|
19
|
+
[._]s[a-w][a-z]
|
20
|
+
*.un~
|
21
|
+
Session.vim
|
22
|
+
.netrwhist
|
23
|
+
*~
|
24
|
+
|
25
|
+
#####=== Ruby ===#####
|
26
|
+
|
27
|
+
*.gem
|
28
|
+
*.rbc
|
29
|
+
/.config
|
30
|
+
/coverage/
|
31
|
+
/InstalledFiles
|
32
|
+
/pkg/
|
33
|
+
/spec/reports/
|
34
|
+
/test/tmp/
|
35
|
+
/test/version_tmp/
|
36
|
+
/tmp/
|
37
|
+
|
38
|
+
## Specific to RubyMotion:
|
39
|
+
.dat*
|
40
|
+
.repl_history
|
41
|
+
build/
|
42
|
+
|
43
|
+
## Documentation cache and generated files:
|
44
|
+
/.yardoc/
|
45
|
+
/_yardoc/
|
46
|
+
/doc/
|
47
|
+
/rdoc/
|
48
|
+
|
49
|
+
## Environment normalisation:
|
50
|
+
/.bundle/
|
51
|
+
/lib/bundler/man/
|
52
|
+
|
53
|
+
# for a library or gem, you might want to ignore these files since the code is
|
54
|
+
# intended to run in multiple environments; otherwise, check them in:
|
55
|
+
# Gemfile.lock
|
56
|
+
# .ruby-version
|
57
|
+
# .ruby-gemset
|
58
|
+
|
59
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
60
|
+
.rvmrc
|
61
|
+
|
62
|
+
#####=== OSX ===#####
|
63
|
+
.DS_Store
|
64
|
+
.AppleDouble
|
65
|
+
.LSOverride
|
66
|
+
|
67
|
+
# Icon must end with two \r
|
68
|
+
Icon
|
69
|
+
|
70
|
+
# Thumbnails
|
71
|
+
._*
|
72
|
+
|
73
|
+
# Files that might appear on external disk
|
74
|
+
.Spotlight-V100
|
75
|
+
.Trashes
|
76
|
+
|
77
|
+
# Directories potentially created on remote AFP share
|
78
|
+
.AppleDB
|
79
|
+
.AppleDesktop
|
80
|
+
Network Trash Folder
|
81
|
+
Temporary Items
|
82
|
+
.apdisk
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 neiro
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# Capistrano_pm2
|
2
|
+
|
3
|
+
PM2 support for Capistrano 3.x.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'capistrano_pm2'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install capistrano_pm2
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Require in Capfile to use the default task:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'capistrano/pm2'
|
27
|
+
```
|
28
|
+
**pm2:restart** task will run after **deploy:updated** as part of Capistrano's default deploy, or can be run in isolation with `bundle exec cap production pm2:restart`
|
29
|
+
|
30
|
+
Configurable options:
|
31
|
+
```ruby
|
32
|
+
set :pm2_config, 'config/pm2.json' # PM2 config path by default
|
33
|
+
```
|
34
|
+
|
35
|
+
## Tasks list
|
36
|
+
|
37
|
+
With config:
|
38
|
+
`cap pm2:stop # Stop server `
|
39
|
+
`cap pm2:start # Start server `
|
40
|
+
`cap pm2:restart # Restart server `
|
41
|
+
|
42
|
+
Without config:
|
43
|
+
`cap pm2:delete[id] # Delete process by id or name`
|
44
|
+
`cap pm2:describe[id] # Describe process by id or name`
|
45
|
+
`cap pm2:kill # Kill PM2`
|
46
|
+
`cap pm2:list # List of processes`
|
47
|
+
`cap pm2:save # Save the processes list`
|
48
|
+
`cap pm2:startup # Startup script`
|
49
|
+
|
50
|
+
|
51
|
+
## Contributing
|
52
|
+
|
53
|
+
1. Fork it ( https://github.com/[my-github-username]/capistrano_pm2/fork )
|
54
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
55
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
56
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
57
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'capistrano_pm2/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'capistrano_pm2'
|
8
|
+
spec.version = CapistranoPm2::VERSION
|
9
|
+
spec.authors = ['neiro']
|
10
|
+
spec.email = ['neiro.mail@gmail.com']
|
11
|
+
spec.summary = 'Capistrano integration for PM2'
|
12
|
+
spec.description = 'Capistrano integration for node.js \
|
13
|
+
process manager PM2 '
|
14
|
+
spec.homepage = 'https://github.com/ne1ro/capistrano_pm2'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files`.split $/
|
18
|
+
spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)/)
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_runtime_dependency 'capistrano', '~> 3.0', '>= 3.0.0'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'rubocop', '~> 0.29.0'
|
27
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/pm2.rake', __FILE__)
|
@@ -0,0 +1,79 @@
|
|
1
|
+
desc 'PM2 integration'
|
2
|
+
namespace :pm2 do
|
3
|
+
desc 'Restart server'
|
4
|
+
task :restart do
|
5
|
+
on roles(:web) do
|
6
|
+
within current_path do
|
7
|
+
execute :pm2, 'restart', fetch(:pm2_config)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Stop server'
|
13
|
+
task :stop do
|
14
|
+
on roles(:web) do
|
15
|
+
within current_path do
|
16
|
+
execute :pm2, 'stop', fetch(:pm2_config)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'Start server'
|
22
|
+
task :start do
|
23
|
+
on roles(:web) do
|
24
|
+
within current_path do
|
25
|
+
execute :pm2, 'start', fetch(:pm2_config)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Kill PM2'
|
31
|
+
task :kill do
|
32
|
+
on roles(:web) do
|
33
|
+
execute :pm2, 'kill'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
desc 'List of processes'
|
38
|
+
task :list do
|
39
|
+
on roles(:web) do
|
40
|
+
info "Processes list: \n #{ capture :pm2, 'list' }"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
desc 'Startup script'
|
45
|
+
task :startup do
|
46
|
+
on roles(:web) do
|
47
|
+
execute :pm2, 'startup'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
desc 'Save the processes list'
|
52
|
+
task :save do
|
53
|
+
on roles(:web) do
|
54
|
+
execute :pm2, 'save'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
desc 'Describe process by id or name'
|
59
|
+
task :describe, :id do |_task, args|
|
60
|
+
on roles(:web) do
|
61
|
+
info(capture :pm2, 'describe', args[:id])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
desc 'Delete process by id or name'
|
66
|
+
task :delete, :id do |_task, args|
|
67
|
+
on roles(:web) do
|
68
|
+
execute :pm2, 'delete', args[:id]
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
after 'deploy:updated', :restart
|
73
|
+
end
|
74
|
+
|
75
|
+
namespace :load do
|
76
|
+
task :defaults do
|
77
|
+
set :pm2_config, 'config/pm2.json'
|
78
|
+
end
|
79
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano_pm2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- neiro
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-13 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.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.0.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.7'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.7'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '10.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '10.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rubocop
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 0.29.0
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.29.0
|
75
|
+
description: "Capistrano integration for node.js \\\n process manager PM2 "
|
76
|
+
email:
|
77
|
+
- neiro.mail@gmail.com
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- ".gitignore"
|
83
|
+
- Gemfile
|
84
|
+
- LICENSE.txt
|
85
|
+
- README.md
|
86
|
+
- Rakefile
|
87
|
+
- capistrano_pm2.gemspec
|
88
|
+
- lib/capistrano/pm2.rb
|
89
|
+
- lib/capistrano/tasks/pm2.rake
|
90
|
+
- lib/capistrano_pm2.rb
|
91
|
+
- lib/capistrano_pm2/version.rb
|
92
|
+
homepage: https://github.com/ne1ro/capistrano_pm2
|
93
|
+
licenses:
|
94
|
+
- MIT
|
95
|
+
metadata: {}
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
require_paths:
|
99
|
+
- lib
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
requirements: []
|
111
|
+
rubyforge_project:
|
112
|
+
rubygems_version: 2.4.5
|
113
|
+
signing_key:
|
114
|
+
specification_version: 4
|
115
|
+
summary: Capistrano integration for PM2
|
116
|
+
test_files: []
|