procman 1.8.0 → 1.9.0
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.
- data/README.md +2 -0
- data/lib/proc_man.rb +1 -1
- data/lib/proc_man/capistrano3.rb +60 -0
- metadata +4 -4
- data/procman-1.7.2.gem +0 -0
data/README.md
CHANGED
@@ -135,6 +135,8 @@ commands whenever you deploy. Just require the deploy recipes in your `Capfile`.
|
|
135
135
|
require 'proc_man/capistrano'
|
136
136
|
```
|
137
137
|
|
138
|
+
If you're using Capistrano 3 require `procman/capistrano3` instead.
|
139
|
+
|
138
140
|
This requires that you are using bundler and the `procman` gem has been included in your Gemfile.
|
139
141
|
|
140
142
|
If you'd like to start/stop/restart your processes using capistrano you can issue the following command. Optionally set `-s processes=worker` to restart only your worker process.
|
data/lib/proc_man.rb
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
SSHKit.config.command_map[:procman] = '/usr/bin/env bundle exec procman'
|
2
|
+
|
3
|
+
namespace :procman do
|
4
|
+
desc 'Start procman processes'
|
5
|
+
task :start do
|
6
|
+
on roles(fetch(:procman_roles)) do
|
7
|
+
within release_path do
|
8
|
+
execute :procman, procman_command(:start)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Stop procman processes'
|
14
|
+
task :stop do
|
15
|
+
on roles(fetch(:procman_roles)) do
|
16
|
+
within release_path do
|
17
|
+
execute :procman, procman_command(:stop)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Restart procman processes'
|
23
|
+
task :restart do
|
24
|
+
on roles(fetch(:procman_roles)) do
|
25
|
+
within release_path do
|
26
|
+
execute :procman, procman_command(:restart)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
after 'deploy:restart', "procman:restart"
|
32
|
+
|
33
|
+
def procman_command(command)
|
34
|
+
|
35
|
+
procfile_path = fetch(:procfile_path, "#{current_path}/Procfile")
|
36
|
+
procfile = procfile_path ? " --procfile #{procfile_path}" : ''
|
37
|
+
|
38
|
+
if processes = fetch(:processes, nil)
|
39
|
+
process_opts = "--processes #{processes}"
|
40
|
+
else
|
41
|
+
process_opts = ''
|
42
|
+
end
|
43
|
+
|
44
|
+
#command = "sh -c \"cd #{current_path} && bundle exec procman #{command} --root #{current_path} --environment #{fetch(:rails_env, 'production')} #{procfile} #{process_opts} \""
|
45
|
+
command = "#{command} --root #{current_path} --environment #{fetch(:rails_env, 'production')} #{procfile} #{process_opts}"
|
46
|
+
|
47
|
+
if user = fetch(:procman_user, nil)
|
48
|
+
command = "sudo -u #{user} #{command}"
|
49
|
+
end
|
50
|
+
|
51
|
+
command
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
namespace :load do
|
57
|
+
task :defaults do
|
58
|
+
set :procman_roles, fetch(:procman_roles, [:app])
|
59
|
+
end
|
60
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A very very simple library for starting/stopping/restarting processes
|
15
15
|
for a Ruby application
|
@@ -21,6 +21,7 @@ extra_rdoc_files: []
|
|
21
21
|
files:
|
22
22
|
- bin/procman
|
23
23
|
- lib/proc_man/capistrano.rb
|
24
|
+
- lib/proc_man/capistrano3.rb
|
24
25
|
- lib/proc_man/constraint.rb
|
25
26
|
- lib/proc_man/process.rb
|
26
27
|
- lib/proc_man/procfile.rb
|
@@ -28,7 +29,6 @@ files:
|
|
28
29
|
- lib/procman/capistrano.rb
|
29
30
|
- LICENCE
|
30
31
|
- Procfile.template
|
31
|
-
- procman-1.7.2.gem
|
32
32
|
- procman.gemspec
|
33
33
|
- README.md
|
34
34
|
homepage: http://atechmedia.com
|
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
53
|
rubyforge_project:
|
54
|
-
rubygems_version: 1.8.23
|
54
|
+
rubygems_version: 1.8.23.2
|
55
55
|
signing_key:
|
56
56
|
specification_version: 3
|
57
57
|
summary: A very very simple library for starting/stopping/restarting processes for
|
data/procman-1.7.2.gem
DELETED
Binary file
|