capistrano-pm2 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/capistrano-pm2.gemspec +1 -1
- data/lib/capistrano/tasks/pm2.rake +16 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 563568286ec77bdb5708e62b3f1fda71ac5c3623
|
4
|
+
data.tar.gz: 5e138cd5f54a7da45fb9f39feb5ea246b85dd0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4580848f12a2f09669cc7644f731e352d6b8952141f9a95a9930963ee3b98a817ef6d92169c350b2c3dcf5d80fa157a3cdf28e1f4295bbbb0251599acaa1d765
|
7
|
+
data.tar.gz: 759cd11aa69106de8719e67adcf4bcc6a570ade103da194a139451419e0d6b41c1460ef8c09c7719e4737d682b7e0eaeb9c9f989d523b6783f9fcb7ee2ac008c
|
data/README.md
CHANGED
@@ -52,16 +52,17 @@ cap pm2:setup # Install pm2 via npm on the remote host
|
|
52
52
|
cap pm2:start # Start pm2 application
|
53
53
|
cap pm2:status # List all pm2 applications
|
54
54
|
cap pm2:stop # Stop pm2 application
|
55
|
+
cap pm2:save # Save pm2 state so it can be loaded after restart
|
55
56
|
```
|
56
57
|
|
57
58
|
Configurable options:
|
58
59
|
```ruby
|
59
|
-
set :pm2_app_command, 'main.js' #
|
60
|
-
set :pm2_app_name,
|
61
|
-
set :pm2_target_path, -> { release_path
|
62
|
-
set :pm2_roles, :all #
|
63
|
-
set :pm2_env_variables, {} # default
|
64
|
-
set :pm2_start_params, '' #
|
60
|
+
set :pm2_app_command, 'main.js' # the main program
|
61
|
+
set :pm2_app_name, fetch(:application) # name for pm2 app
|
62
|
+
set :pm2_target_path, -> { release_path } # where to run pm2 commands
|
63
|
+
set :pm2_roles, :all # server roles where pm2 runs on
|
64
|
+
set :pm2_env_variables, {} # default: env vars for pm2
|
65
|
+
set :pm2_start_params, '' # pm2 start params see http://pm2.keymetrics.io/docs/usage/quick-start/#cheat-sheet
|
65
66
|
```
|
66
67
|
|
67
68
|
## Contributing
|
data/capistrano-pm2.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'capistrano-pm2'
|
7
|
-
spec.version = '1.0.
|
7
|
+
spec.version = '1.0.5'
|
8
8
|
spec.authors = ['Tom Hanoldt']
|
9
9
|
spec.email = ['monotom@gmail.com']
|
10
10
|
spec.description = 'nodejs pm2 support for Capistrano 3.x'
|
@@ -68,24 +68,28 @@ namespace :pm2 do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def app_status
|
71
|
-
within
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
71
|
+
within release_path do
|
72
|
+
with fetch(:pm2_env_variables) do
|
73
|
+
ps = JSON.parse(capture :pm2, :jlist, :'-s')
|
74
|
+
|
75
|
+
# find the process with our app name
|
76
|
+
ps.each do |child|
|
77
|
+
if child['name'] == app_name
|
78
|
+
# status: online, errored, stopped
|
79
|
+
return child['pm2_env']['status']
|
80
|
+
end
|
79
81
|
end
|
80
|
-
end
|
81
82
|
|
82
|
-
|
83
|
+
return nil
|
84
|
+
end
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
86
88
|
def restart_app
|
87
|
-
within
|
88
|
-
|
89
|
+
within release_path do
|
90
|
+
with fetch(:pm2_env_variables) do
|
91
|
+
execute :pm2, :restart, app_name
|
92
|
+
end
|
89
93
|
end
|
90
94
|
end
|
91
95
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-pm2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Hanoldt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.6.11
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: nodejs pm2 support for Capistrano 3.x
|