capistrano3-unicorn 0.0.6 → 0.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -3
- data/README.md +5 -1
- data/capistrano3-unicorn.gemspec +2 -2
- data/lib/capistrano3/tasks/unicorn.rake +22 -21
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b168296fd207748bc5d31bfab2290c0f4e88881
|
4
|
+
data.tar.gz: 5b3afbdb6d0009e2890c040e4e36498fc2424102
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f0e2f664e19886a250c1dce57d529c00f768392cd4500632f47382ff22169c29de2a9b5fccdaa4c55e10ca3bef1e10d54a8a72fbd07713e50d98417fa935e24
|
7
|
+
data.tar.gz: 271607b8f7b817a8d9b4e56d2cb214731bec30d291e57241330e7c2582255a18b2495093c3a91c8f4486d8680d986c2b883c76813af79401bb76a445c1a52ac4
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,22 @@
|
|
1
|
-
|
1
|
+
# Capistrano3 Unicorn Changelog
|
2
|
+
|
3
|
+
## `0.1.0`
|
4
|
+
|
5
|
+
- Changed default location of `:unicorn_pid`
|
6
|
+
- Depend on capistrano => 3.1.0
|
7
|
+
- Added `:unicorn_bundle_gemfile` to override `:bundle_gemfile`
|
8
|
+
- Bugfix; use current_path vs release_path
|
9
|
+
|
10
|
+
Thanks to @eLod, @mbrictson, and @complistic-gaff
|
11
|
+
|
12
|
+
## `0.0.6`
|
2
13
|
|
3
14
|
- Buxfix; unicorn -E should be passed a RACK_ENV (not a RAILS_ENV). [More here](http://www.hezmatt.org/~mpalmer/blog/2013/10/13/rack_env-its-not-for-you)
|
4
15
|
|
5
|
-
|
16
|
+
## `0.0.5`
|
6
17
|
|
7
18
|
- Added `:unicorn_options`
|
8
19
|
|
9
|
-
|
20
|
+
## `0.0.4`
|
10
21
|
|
11
22
|
- Added `:unicorn_roles`
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ You can override the defaults by `set :unicorn_example, value` in the `config/de
|
|
16
16
|
|
17
17
|
- `:unicorn_pid`
|
18
18
|
|
19
|
-
Assumes your pid file will be located in
|
19
|
+
Assumes your pid file will be located in `tmp/pids/unicorn.pid` which is symlinked by `:linked_dirs` to survive across deployments
|
20
20
|
|
21
21
|
- `:unicorn_config_path`
|
22
22
|
|
@@ -59,6 +59,7 @@ Invoke Unicorn from your `config/deploy.rb` or `config/deploy/ENVIRONMENT.rb`:
|
|
59
59
|
If `preload_app:true` use:
|
60
60
|
|
61
61
|
```ruby
|
62
|
+
after 'deploy:publishing', 'deploy:restart'
|
62
63
|
namespace :deploy do
|
63
64
|
task :restart do
|
64
65
|
invoke 'unicorn:restart'
|
@@ -69,9 +70,12 @@ end
|
|
69
70
|
Otherwise use:
|
70
71
|
|
71
72
|
```ruby
|
73
|
+
after 'deploy:publishing', 'deploy:restart'
|
72
74
|
namespace :deploy do
|
73
75
|
task :restart do
|
74
76
|
invoke 'unicorn:reload'
|
75
77
|
end
|
76
78
|
end
|
77
79
|
```
|
80
|
+
|
81
|
+
Note that presently you must put the `invoke` outside any `on` block since the task handles this for you; otherwise you will get an `undefined method 'verbosity'` error.
|
data/capistrano3-unicorn.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "capistrano3-unicorn"
|
6
|
-
gem.version = '0.0
|
6
|
+
gem.version = '0.1.0'
|
7
7
|
gem.authors = ["Matthew Lineen"]
|
8
8
|
gem.email = ["matthew@lineen.com"]
|
9
9
|
gem.description = "Unicorn specific Capistrano tasks"
|
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
|
-
gem.add_dependency 'capistrano', '>= 3.
|
18
|
+
gem.add_dependency 'capistrano', '>= 3.1.0'
|
19
19
|
end
|
@@ -1,23 +1,24 @@
|
|
1
1
|
namespace :load do
|
2
2
|
task :defaults do
|
3
|
-
set :unicorn_pid, -> { File.join(
|
3
|
+
set :unicorn_pid, -> { File.join(current_path, "tmp", "pids", "unicorn.pid") }
|
4
4
|
set :unicorn_config_path, -> { File.join(current_path, "config", "unicorn", "#{fetch(:rails_env)}.rb") }
|
5
5
|
set :unicorn_restart_sleep_time, 3
|
6
6
|
set :unicorn_roles, -> { :app }
|
7
|
-
set :unicorn_options, -> {
|
8
|
-
set :unicorn_rack_env, -> { fetch(:rails_env) ==
|
7
|
+
set :unicorn_options, -> { "" }
|
8
|
+
set :unicorn_rack_env, -> { fetch(:rails_env) == "development" ? "development" : "deployment" }
|
9
|
+
set :unicorn_bundle_gemfile, -> { fetch(:bundle_gemfile, File.join(current_path, "Gemfile")) }
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
12
13
|
namespace :unicorn do
|
13
|
-
desc
|
14
|
+
desc "Start Unicorn"
|
14
15
|
task :start do
|
15
16
|
on roles(fetch(:unicorn_roles)) do
|
16
|
-
within
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
within current_path do
|
18
|
+
if test("[ -e #{fetch(:unicorn_pid)} ] && kill -0 #{pid}")
|
19
|
+
info "unicorn is running..."
|
20
|
+
else
|
21
|
+
with rails_env: fetch(:rails_env), bundle_gemfile: fetch(:unicorn_bundle_gemfile) do
|
21
22
|
execute :bundle, "exec unicorn", "-c", fetch(:unicorn_config_path), "-E", fetch(:unicorn_rack_env), "-D", fetch(:unicorn_options)
|
22
23
|
end
|
23
24
|
end
|
@@ -25,10 +26,10 @@ namespace :unicorn do
|
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
|
-
desc
|
29
|
+
desc "Stop Unicorn (QUIT)"
|
29
30
|
task :stop do
|
30
31
|
on roles(fetch(:unicorn_roles)) do
|
31
|
-
within
|
32
|
+
within current_path do
|
32
33
|
if test("[ -e #{fetch(:unicorn_pid)} ]")
|
33
34
|
if test("kill -0 #{pid}")
|
34
35
|
info "stopping unicorn..."
|
@@ -44,22 +45,22 @@ namespace :unicorn do
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
|
-
desc
|
48
|
+
desc "Reload Unicorn (HUP); use this when preload_app: false"
|
48
49
|
task :reload do
|
49
|
-
invoke
|
50
|
+
invoke "unicorn:start"
|
50
51
|
on roles(fetch(:unicorn_roles)) do
|
51
|
-
within
|
52
|
+
within current_path do
|
52
53
|
info "reloading..."
|
53
54
|
execute :kill, "-s HUP", pid
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
58
|
-
desc
|
59
|
+
desc "Restart Unicorn (USR2 + QUIT); use this when preload_app: true"
|
59
60
|
task :restart do
|
60
|
-
invoke
|
61
|
+
invoke "unicorn:start"
|
61
62
|
on roles(fetch(:unicorn_roles)) do
|
62
|
-
within
|
63
|
+
within current_path do
|
63
64
|
info "unicorn restarting..."
|
64
65
|
execute :kill, "-s USR2", pid
|
65
66
|
execute :sleep, fetch(:unicorn_restart_sleep_time)
|
@@ -70,20 +71,20 @@ namespace :unicorn do
|
|
70
71
|
end
|
71
72
|
end
|
72
73
|
|
73
|
-
desc
|
74
|
+
desc "Add a worker (TTIN)"
|
74
75
|
task :add_worker do
|
75
76
|
on roles(fetch(:unicorn_roles)) do
|
76
|
-
within
|
77
|
+
within current_path do
|
77
78
|
info "adding worker"
|
78
79
|
execute :kill, "-s TTIN", pid
|
79
80
|
end
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
83
|
-
desc
|
84
|
+
desc "Remove a worker (TTOU)"
|
84
85
|
task :remove_worker do
|
85
86
|
on roles(fetch(:unicorn_roles)) do
|
86
|
-
within
|
87
|
+
within current_path do
|
87
88
|
info "removing worker"
|
88
89
|
execute :kill, "-s TTOU", pid
|
89
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano3-unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Lineen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.
|
19
|
+
version: 3.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.
|
26
|
+
version: 3.1.0
|
27
27
|
description: Unicorn specific Capistrano tasks
|
28
28
|
email:
|
29
29
|
- matthew@lineen.com
|