capistrano-simple-unicorn 1.1.1 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66d57a5d0443dbfb99e562ac9748766ebc2da08e
4
- data.tar.gz: f476b643217620a941e0d1ccca0bef1d21bc9219
3
+ metadata.gz: b64ae6673a801efdb0c2fee3aa06ad515367ac26
4
+ data.tar.gz: 9b01051e95a1716b79477b34eb244444d1f1e265
5
5
  SHA512:
6
- metadata.gz: d9250ee916e9e2e92d5cbc9cfa448012695c605737e42a7d9144d13679c462383c161f9bafcad67079fd7a404dcbbb7f1200aba7480b8c26565a1b8549ef40ad
7
- data.tar.gz: eda38d917f869e63464d6fb387aeee7beb0d93983c1f2a63a28c488099f65862694f230c38633039587ed6e77bc82e8d4998b602b57129ea80227685ef7f8d3b
6
+ metadata.gz: 89116c1128e906762ee4c222d1fd8716a7dfcadc454e681e83c1f3c61564c80ae9d52aeeeb33abcaad46ee7b848059b0ef52d7083cc12695deddd2212d4c9a4a
7
+ data.tar.gz: a72e9cbddf1ebfccf7c1e4935bbee3db5cfa5d6521e1360ffcdee70472381df660adab1d4a7ec6ccd4ec48274214fa1492a53aa9899057eb2bc8f52a8e7aeb8a
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module SimpleUnicorn
3
- VERSION = '1.1.1'.freeze
3
+ VERSION = '1.1.2'.freeze
4
4
  end
5
5
  end
@@ -23,63 +23,99 @@ namespace :load do
23
23
  end
24
24
 
25
25
  namespace :unicorn do
26
- desc 'Start Unicorn'
26
+ desc "Start Unicorn"
27
27
  task :start do
28
28
  on roles(fetch(:unicorn_roles)) do
29
29
  within current_path do
30
- if test("[ -e #{fetch(:unicorn_pid)} ] && kill -0 #{pid}")
31
- info 'unicorn is running...'
30
+ if test("[ -e #{fetch(:unicorn_pid_path)} ] && kill -0 #{pid}")
31
+ info "unicorn is running..."
32
32
  else
33
33
  with rails_env: fetch(:rails_env) do
34
- execute :bundle, 'exec unicorn', '-c', fetch(:unicorn_config_path), '-E', fetch(:unicorn_env), '-D', fetch(:unicorn_options)
34
+ execute :bundle, "exec unicorn", "-c", fetch(:unicorn_config_path), "-E", fetch(:unicorn_env), "-D", fetch(:unicorn_options)
35
35
  end
36
36
  end
37
37
  end
38
38
  end
39
39
  end
40
40
 
41
- desc 'Stop Unicorn (QUIT)'
41
+ desc "Stop Unicorn (QUIT)"
42
42
  task :stop do
43
43
  on roles(fetch(:unicorn_roles)) do
44
44
  within current_path do
45
45
  if test("[ -e #{fetch(:unicorn_pid_path)} ]")
46
46
  if test("kill -0 #{pid}")
47
- info 'stopping unicorn...'
48
- execute :kill, '-s QUIT', pid
47
+ info "stopping unicorn..."
48
+ execute :kill, "-s QUIT", pid
49
49
  else
50
- info 'cleaning up dead unicorn pid...'
50
+ info "cleaning up dead unicorn pid..."
51
51
  execute :rm, fetch(:unicorn_pid_path)
52
52
  end
53
53
  else
54
- info 'unicorn is not running...'
54
+ info "unicorn is not running..."
55
55
  end
56
56
  end
57
57
  end
58
58
  end
59
59
 
60
- desc 'Restart Unicorn (USR2); use this when preload_app: true'
60
+ desc "Reload Unicorn (HUP); use this when preload_app: false"
61
+ task :reload do
62
+ invoke "unicorn:start"
63
+ on roles(fetch(:unicorn_roles)) do
64
+ within current_path do
65
+ info "reloading..."
66
+ execute :kill, "-s HUP", pid
67
+ end
68
+ end
69
+ end
70
+
71
+ desc "Restart Unicorn (USR2); use this when preload_app: true"
61
72
  task :restart do
62
- invoke 'unicorn:start'
73
+ invoke "unicorn:start"
63
74
  on roles(fetch(:unicorn_roles)) do
64
75
  within current_path do
65
- info 'unicorn restarting...'
66
- execute :kill, '-s USR2', pid
76
+ info "unicorn restarting..."
77
+ execute :kill, "-s USR2", pid
67
78
  end
68
79
  end
69
80
  end
70
81
 
71
- desc 'Legacy Restart (USR2 + QUIT); use this when preload_app: true and oldbin pid needs cleanup'
82
+ desc "Duplicate Unicorn; alias of unicorn:restart"
83
+ task :duplicate do
84
+ invoke "unicorn:restart"
85
+ end
86
+
87
+ desc "Legacy Restart (USR2 + QUIT); use this when preload_app: true and oldbin pid needs cleanup"
72
88
  task :legacy_restart do
73
- invoke 'unicorn:restart'
89
+ invoke "unicorn:restart"
74
90
  on roles(fetch(:unicorn_roles)) do
75
91
  within current_path do
76
92
  execute :sleep, fetch(:unicorn_restart_sleep_time)
77
93
  if test("[ -e #{fetch(:unicorn_pid_path)}.oldbin ]")
78
- execute :kill, '-s QUIT', pid_oldbin
94
+ execute :kill, "-s QUIT", pid_oldbin
79
95
  end
80
96
  end
81
97
  end
82
98
  end
99
+
100
+ desc "Add a worker (TTIN)"
101
+ task :add_worker do
102
+ on roles(fetch(:unicorn_roles)) do
103
+ within current_path do
104
+ info "adding worker"
105
+ execute :kill, "-s TTIN", pid
106
+ end
107
+ end
108
+ end
109
+
110
+ desc "Remove a worker (TTOU)"
111
+ task :remove_worker do
112
+ on roles(fetch(:unicorn_roles)) do
113
+ within current_path do
114
+ info "removing worker"
115
+ execute :kill, "-s TTOU", pid
116
+ end
117
+ end
118
+ end
83
119
  end
84
120
 
85
121
  def pid
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-simple-unicorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - truongkma
@@ -66,6 +66,8 @@ files:
66
66
  - Gemfile
67
67
  - README.md
68
68
  - Rakefile
69
+ - capistrano-simple-unicorn-1.1.0.gem
70
+ - capistrano-simple-unicorn-1.1.1.gem
69
71
  - capistrano-simple-unicorn.gemspec
70
72
  - lib/capistrano-simple-unicorn.rb
71
73
  - lib/capistrano/simple_unicorn.rb