glebtv-capistrano-unicorn 0.4.0 → 0.4.1

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: 1b3e269b06dadaa79a330e1a68de83b93e18b4b9
4
- data.tar.gz: e875511de350029514c58e2c8ec618b1a8488fdd
3
+ metadata.gz: f2635da2f2f63b001837a1179917779478682ecc
4
+ data.tar.gz: 55df11ef99a56d211c3f0acd8239851c33dc5734
5
5
  SHA512:
6
- metadata.gz: 28fa51f25b0a60172019f9108f4d9e6b08c462fa792c525341c13b040fa278e33d4214cde391b2be2dc3a5c02c14f8f77d3de0ead8db2d60fcc4d9a6fcc4686f
7
- data.tar.gz: aaddf4ce3444d94714c68a8f25e73208e282f6229f9427ab4063d7658aeac63ef5df1a62251ca484cde8a2f70c3c8207eeaf1cccd48d86174223666685b78eb3
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:restart', 'unicorn:reload' # app IS NOT preloaded
32
- after 'deploy:restart', 'unicorn:restart' # app preloaded
33
- after 'deploy:restart', 'unicorn:duplicate' # before_fork hook implemented (zero downtime deployments)
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
@@ -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
- with rails_env: fetch(:rails_env), bundle_gemfile: fetch(:bundle_gemfile) do
128
- execute :bundle, 'exec', fetch(:unicorn_bin), '-c', unicorn_config_file_path, '-E', fetch(:unicorn_rack_env), '-D', fetch(:unicorn_options)
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
@@ -1,5 +1,5 @@
1
1
  module CapistranoUnicorn
2
2
  unless defined?(::CapistranoUnicorn::VERSION)
3
- VERSION = "0.4.0".freeze
3
+ VERSION = "0.4.1".freeze
4
4
  end
5
5
  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.0
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-12 00:00:00.000000000 Z
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake