glebtv-capistrano-unicorn 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -8
- data/examples/rails3.rb +0 -2
- data/lib/capistrano/tasks/unicorn.rake +0 -1
- data/lib/capistrano/unicorn/utility.rb +8 -2
- data/lib/capistrano/unicorn/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2635da2f2f63b001837a1179917779478682ecc
|
4
|
+
data.tar.gz: 55df11ef99a56d211c3f0acd8239851c33dc5734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0aec1c6e01337285e3babac8badf010920c21079465393b0d7eacad04a5cc66a284e85b7d4a9fef0139216829f3067fd7fd4df420cc9c4410d5b95a1cbe3c92
|
7
|
+
data.tar.gz: d6ba09de4180bd9a41bfcb1db0b12ed70c9364aeea01f254b267a73b09f32ccfe9581d54e24b28f8e097eb66eddaab32161b1919995e0bf16c1426ce3402052a
|
data/README.md
CHANGED
@@ -7,11 +7,9 @@ Taken from https://github.com/sosedoff/capistrano-unicorn and adapted to work wi
|
|
7
7
|
|
8
8
|
## Usage
|
9
9
|
|
10
|
-
If you are upgrading from a previous version, please see the [NEWS file](NEWS.md).
|
11
|
-
|
12
10
|
### Setup
|
13
11
|
|
14
|
-
Add the library to your `Gemfile
|
12
|
+
**Add the library to your `Gemfile`:**
|
15
13
|
|
16
14
|
```ruby
|
17
15
|
group :development do
|
@@ -19,18 +17,30 @@ group :development do
|
|
19
17
|
end
|
20
18
|
```
|
21
19
|
|
22
|
-
Add it to `Capfile
|
20
|
+
**Add it to `Capfile`:**
|
23
21
|
|
24
22
|
```ruby
|
25
23
|
require 'capistrano/unicorn'
|
26
24
|
```
|
27
25
|
|
28
|
-
Add unicorn restart task hook
|
26
|
+
**Add unicorn restart task hook:**
|
27
|
+
|
28
|
+
If your app IS NOT preloaded (preload_app false, default):
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
after 'deploy:publishing', 'unicorn:reload'
|
32
|
+
```
|
33
|
+
|
34
|
+
If your app is preloaded (preload_app true):
|
29
35
|
|
30
36
|
```ruby
|
31
|
-
after 'deploy:
|
32
|
-
|
33
|
-
|
37
|
+
after 'deploy:publishing', 'unicorn:restart'
|
38
|
+
```
|
39
|
+
|
40
|
+
If you have before_fork unicorn hook for zero downtime deployments installed (preload_app true + before_hook), best option:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
after 'deploy:publishing', 'unicorn:duplicate'
|
34
44
|
```
|
35
45
|
|
36
46
|
Create a new configuration file `config/unicorn.rb` or `config/unicorn/STAGE.rb`,
|
@@ -42,6 +52,9 @@ Includes zero-downtime deployments
|
|
42
52
|
|
43
53
|
[examples/rails3.rb](https://github.com/glebtv/capistrano-unicorn/blob/master/examples/rails3.rb).
|
44
54
|
|
55
|
+
Please READ all comments in the file if you are having problems.
|
56
|
+
If you use AR you need to uncomment two lines in the file.
|
57
|
+
|
45
58
|
Please refer to Unicorn documentation for more examples and configuration options.
|
46
59
|
|
47
60
|
### Deploy
|
data/examples/rails3.rb
CHANGED
@@ -39,8 +39,6 @@ before_exec do |server|
|
|
39
39
|
end
|
40
40
|
|
41
41
|
before_fork do |server, worker|
|
42
|
-
# при использовании preload_app = true здесь должно быть закрытие всех открытых сокетов
|
43
|
-
|
44
42
|
# uncomment for AR
|
45
43
|
# ActiveRecord::Base.connection.disconnect
|
46
44
|
# Mongoid reconnects itself
|
@@ -6,7 +6,6 @@ include CapistranoUnicorn::Utility
|
|
6
6
|
# See https://github.com/capistrano/capistrano/pull/605
|
7
7
|
namespace :load do
|
8
8
|
task :defaults do
|
9
|
-
|
10
9
|
# Environments
|
11
10
|
set :unicorn_env , Proc.new{ fetch(:rails_env, 'production') }
|
12
11
|
# Following recommendations from http://unicorn.bogomips.org/unicorn_1.html
|
@@ -124,8 +124,14 @@ module CapistranoUnicorn
|
|
124
124
|
puts 'Starting unicorn...'
|
125
125
|
|
126
126
|
within fetch(:app_path) do
|
127
|
-
|
128
|
-
|
127
|
+
if fetch(:bundle_gemfile).nil?
|
128
|
+
with rails_env: fetch(:rails_env) do
|
129
|
+
execute :bundle, 'exec', fetch(:unicorn_bin), '-c', unicorn_config_file_path, '-E', fetch(:unicorn_rack_env), '-D', fetch(:unicorn_options)
|
130
|
+
end
|
131
|
+
else
|
132
|
+
with rails_env: fetch(:rails_env), bundle_gemfile: fetch(:bundle_gemfile) do
|
133
|
+
execute :bundle, 'exec', fetch(:unicorn_bin), '-c', unicorn_config_file_path, '-E', fetch(:unicorn_rack_env), '-D', fetch(:unicorn_options)
|
134
|
+
end
|
129
135
|
end
|
130
136
|
end
|
131
137
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glebtv-capistrano-unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv, Sebastian Gassner, Dan Sosedoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|