capistrano-unicorn-nginx 3.0.0 → 3.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 +5 -0
- data/README.md +6 -1
- data/lib/capistrano/dsl/nginx_paths.rb +2 -2
- data/lib/capistrano/tasks/nginx.rake +1 -19
- data/lib/capistrano/tasks/unicorn.rake +1 -1
- data/lib/capistrano/unicorn_nginx/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: 4a085d975552c671521de286709e2e731f7d19bf
|
4
|
+
data.tar.gz: 8bacbef4e56838264db0b0a59771dfcf7a0594d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6bd91e9a7be816ee858a03b28f6b48d0cad24ad99e9f0841b2917924b294087e83f28eb382a23144d5b4fed5fd6e2f14a2c0ae8f288bc7ea95b5e88ade889ff
|
7
|
+
data.tar.gz: 75bb34d856885f4d07aeb17e3e6b57387c88c538896a0489e1d4a394593cb9f19fe298c0b2a32a3e53bb311d02e1f7c670e8588d03f79b939db8cbb1da5b2b3a
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
### master
|
4
4
|
|
5
|
+
### v3.1.0, 2014-10-07
|
6
|
+
- setup nginx and unicorn to use TCP if web and app roles are using different
|
7
|
+
servers
|
8
|
+
- update default nginx log dir location to `/var/log/nginx`
|
9
|
+
|
5
10
|
### v3.0.0, 2014-10-05
|
6
11
|
- enable setting unicorn app environment with `rails_env` option.
|
7
12
|
If `rails_env` is not set, `stage` option is used as until now. (@bruno-)
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ Add this to `Gemfile`:
|
|
26
26
|
|
27
27
|
group :development do
|
28
28
|
gem 'capistrano', '~> 3.2.1'
|
29
|
-
gem 'capistrano-unicorn-nginx', '~> 3.
|
29
|
+
gem 'capistrano-unicorn-nginx', '~> 3.1.0'
|
30
30
|
end
|
31
31
|
|
32
32
|
And then:
|
@@ -43,6 +43,11 @@ Depending on your needs 2 general scenarios are covered:
|
|
43
43
|
- [multiple server setup](https://github.com/capistrano-plugins/capistrano-unicorn-nginx/wiki/Multiple-server-setup)<br/>
|
44
44
|
Webserver (nginx) and application server (unicorn) run on different nodes.
|
45
45
|
|
46
|
+
### Default log file directories
|
47
|
+
|
48
|
+
- nginx: `/var/log/nginx/`
|
49
|
+
- unicorn: `#{shared_path}/log/`
|
50
|
+
|
46
51
|
### Configuration
|
47
52
|
|
48
53
|
See the
|
@@ -37,11 +37,11 @@ module Capistrano
|
|
37
37
|
|
38
38
|
# log files
|
39
39
|
def nginx_access_log_file
|
40
|
-
|
40
|
+
"/var/log/nginx/#{fetch(:nginx_config_name)}.access.log"
|
41
41
|
end
|
42
42
|
|
43
43
|
def nginx_error_log_file
|
44
|
-
|
44
|
+
"/var/log/nginx/#{fetch(:nginx_config_name)}.error.log"
|
45
45
|
end
|
46
46
|
|
47
47
|
end
|
@@ -31,26 +31,8 @@ namespace :nginx do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
# this is needed when the web role is a non release role -> deploy directories are not created, and nginx log files
|
35
|
-
# are written to "#{deploy_path}/shared/log/"
|
36
|
-
desc "Create the nginx log directory"
|
37
|
-
task :create_log_dir do
|
38
|
-
on roles :web do
|
39
|
-
# create the deploy_to, shared_path and the directory in which the nginx_access_log_file resides.
|
40
|
-
# We need to be conservative and ensure that all are created with the correct ownership: it could happen that
|
41
|
-
# web does become a release role later, in which case the ownerships need to be correct.
|
42
|
-
[deploy_path, shared_path, File.dirname(nginx_access_log_file)].each do |dir|
|
43
|
-
next if file_exists? dir
|
44
|
-
sudo :mkdir, '-pv', dir
|
45
|
-
user = capture :id, '-un'
|
46
|
-
group = capture :id, '-gn'
|
47
|
-
sudo :chown, "#{user}:#{group}", dir
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
34
|
desc 'Setup nginx configuration'
|
53
|
-
task setup
|
35
|
+
task :setup do
|
54
36
|
on roles :web do
|
55
37
|
sudo_upload! template('nginx_conf.erb'), nginx_sites_available_file
|
56
38
|
sudo :ln, '-fs', nginx_sites_available_file, nginx_sites_enabled_file
|
@@ -12,7 +12,7 @@ namespace :load do
|
|
12
12
|
set :unicorn_config, -> { unicorn_default_config_file }
|
13
13
|
set :unicorn_workers, 2
|
14
14
|
set :unicorn_tcp_listen_port, 8080
|
15
|
-
set :unicorn_use_tcp, -> { roles(:app).count > 1}
|
15
|
+
set :unicorn_use_tcp, -> { roles(:app, :web).count > 1 } # use tcp if web and app nodes are on different servers
|
16
16
|
set :unicorn_app_env, -> { fetch(:rails_env) || fetch(:stage) }
|
17
17
|
# set :unicorn_user # default set in `unicorn:defaults` task
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-unicorn-nginx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Sutic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|