capistrano-unicorn-nginx 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d07f364efb0a3c692f5a90e291944f3039f0a0a0
4
- data.tar.gz: 261aa7183d26027881a31024196e536f478f59d2
3
+ metadata.gz: 4a085d975552c671521de286709e2e731f7d19bf
4
+ data.tar.gz: 8bacbef4e56838264db0b0a59771dfcf7a0594d5
5
5
  SHA512:
6
- metadata.gz: 1afb2f016b9c6859c722daacc25ab981959dc87834da8d0a76f2add162587d3afaabff5ce3d7230446c43df74ba98a7cf0ceb5a5499310ff5975cbe46e562166
7
- data.tar.gz: e0cd00708bb708bcedd7412b82c448815f6ef49702552ed5523e9a307a353a37cc3c71c0aa021196ad57f2e783f6f71234864755f7bae54061ca7b76f789b11c
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.0.0'
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
- shared_path.join('log/nginx.access.log')
40
+ "/var/log/nginx/#{fetch(:nginx_config_name)}.access.log"
41
41
  end
42
42
 
43
43
  def nginx_error_log_file
44
- shared_path.join('log/nginx.error.log')
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: [:create_log_dir] do
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} # use tcp if there are multiple app nodes
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
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module UnicornNginx
3
- VERSION = "3.0.0"
3
+ VERSION = "3.1.0"
4
4
  end
5
5
  end
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.0.0
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-05 00:00:00.000000000 Z
11
+ date: 2014-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano