capistrano-nginx-unicorn 0.0.6 → 0.0.7

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmYwNTI4YjA3ZjEzYzBmYTIyM2Y4NDAyYTMzNGQ5MTkyY2JhODZhMw==
5
+ data.tar.gz: !binary |-
6
+ M2NkYzhjMGNjOTUxZjZhYjdhNDRiMDNiN2E0YWE5Nzk0ZDQ5NWM2ZA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZjZkZjg4NWI5OTY5MjM0ZjYxNDViODkwNzEyY2RmMWFmNzBhZjMzZmNhMjNj
10
+ ZTEyOWM4YWNhMDAyMmQ3NTEwOWVlMGMzNmMwNWY4NjAyOGJiYTVlMzdhM2I4
11
+ NzU0ZTQ4N2E1M2Q3ZWRmMTUwMzMwMzI5NWU0MDkyNGI3ODdkY2M=
12
+ data.tar.gz: !binary |-
13
+ Mzc2MTc0MWQ1NWEwZWFlN2VkMDg2OTAwMTY3MGRjNTQ5MTQ5Njg4YzM1ZDgw
14
+ MmFjOTM0ODE5OGEwMDU2ZWMxMjZiZDdiZDkwZjZjMzdkMzllMjBiNTM0YTRj
15
+ Njk5NGRjMzZkNzI3ODEzZTJhODgyZGZlNTgyMmIwNzEwNjdkMzE=
data/README.md CHANGED
@@ -64,7 +64,7 @@ and for unicorn:
64
64
  # reload unicorn with no downtime
65
65
  # old workers will process new request until new master is fully loaded
66
66
  # then old workers will be automatically killed and new workers will start processing requests
67
- cap unicorn:reload
67
+ cap unicorn:restart
68
68
 
69
69
  and shared:
70
70
 
@@ -105,6 +105,10 @@ set :nginx_server_name, "example.com"
105
105
  # default value: `"#{current_path}/tmp/pids/unicorn.pid"`
106
106
  set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
107
107
 
108
+ # path, where nginx pid file will be stored (used in logrotate recipe)
109
+ # default value: `"/run/nginx.pid"`
110
+ set :nginx_pid, "/run/nginx.pid"
111
+
108
112
  # path, where unicorn config file will be stored
109
113
  # default value: `"#{shared_path}/config/unicorn.rb"`
110
114
  set :unicorn_config, "#{shared_path}/config/unicorn.rb"
@@ -127,6 +131,10 @@ set :unicorn_workers, 4
127
131
  # default value: false
128
132
  set :nginx_use_ssl, false
129
133
 
134
+ # if set, it will ask to upload certificates from a local path. Otherwise, it will expect
135
+ # the certificate and key defined in the next 2 variables to be already in the server.
136
+ set :nginx_upload_local_certificate, { true }
137
+
130
138
  # remote file name of the certificate, only makes sense if `nginx_use_ssl` is set
131
139
  # default value: `nginx_server_name + ".crt"`
132
140
  set :nginx_ssl_certificate, "#{nginx_server_name}.crt"
@@ -6,18 +6,18 @@ require 'capistrano/nginx_unicorn/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "capistrano-nginx-unicorn"
8
8
  gem.version = Capistrano::NginxUnicorn::VERSION
9
- gem.authors = ["Ivan Tkalin"]
10
- gem.email = ["itkalin@gmail.com"]
11
- gem.description = %q{Deprecated! Capistrano tasks for configuration and management nginx+unicorn combo for zero downtime deployments of Rails applications. Configs can be copied to the application using generators and easily customized.}
12
- gem.summary = %q{Deprecated! Create and manage nginx+unicorn configs from capistrano}
13
- gem.homepage = "https://github.com/ivalkeen/capistrano-nginx-unicorn"
9
+ gem.authors = ["Ivan Tkalin", "Kalys Osmonov"]
10
+ gem.email = ["kalys@osmonov.com"]
11
+ gem.description = %q{Capistrano tasks for configuration and management nginx+unicorn combo for zero downtime deployments of Rails applications. Configs can be copied to the application using generators and easily customized.}
12
+ gem.summary = %q{Create and manage nginx+unicorn configs from capistrano}
13
+ gem.homepage = "https://github.com/kalys/capistrano-nginx-unicorn"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_dependency 'capistrano', '>= 2.0'
20
+ gem.add_dependency 'capistrano', '~> 2.0'
21
21
 
22
22
  gem.add_development_dependency "rake"
23
23
  end
@@ -9,30 +9,40 @@ Capistrano::Configuration.instance.load do
9
9
 
10
10
  set_default(:nginx_server_name) { Capistrano::CLI.ui.ask "Nginx server name: " }
11
11
  set_default(:nginx_use_ssl, false)
12
+ set_default(:nginx_pid) { "/run/nginx.pid" }
12
13
  set_default(:nginx_ssl_certificate) { "#{nginx_server_name}.crt" }
13
14
  set_default(:nginx_ssl_certificate_key) { "#{nginx_server_name}.key" }
15
+ set_default(:nginx_upload_local_certificate) { true }
14
16
  set_default(:nginx_ssl_certificate_local_path) {Capistrano::CLI.ui.ask "Local path to ssl certificate: "}
15
17
  set_default(:nginx_ssl_certificate_key_local_path) {Capistrano::CLI.ui.ask "Local path to ssl certificate key: "}
16
18
 
17
- set_default(:unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid")
18
- set_default(:unicorn_config, "#{shared_path}/config/unicorn.rb")
19
- set_default(:unicorn_log, "#{shared_path}/log/unicorn.log")
20
- set_default(:unicorn_user, user)
19
+ set_default(:unicorn_pid) { "#{current_path}/tmp/pids/unicorn.pid" }
20
+ set_default(:unicorn_config) { "#{shared_path}/config/unicorn.rb" }
21
+ set_default(:unicorn_log) { "#{shared_path}/log/unicorn.log" }
22
+ set_default(:unicorn_user) { user }
21
23
  set_default(:unicorn_workers) { Capistrano::CLI.ui.ask "Number of unicorn workers: " }
24
+
25
+ set_default(:nginx_config_path) { "/etc/nginx/sites-available" }
22
26
 
23
27
  namespace :nginx do
24
28
  desc "Setup nginx configuration for this application"
25
29
  task :setup, roles: :web do
26
30
  template("nginx_conf.erb", "/tmp/#{application}")
27
- run "#{sudo} mv /tmp/#{application} /etc/nginx/sites-available/#{application}"
28
- run "#{sudo} ln -fs /etc/nginx/sites-available/#{application} /etc/nginx/sites-enabled/#{application}"
31
+ if nginx_config_path == "/etc/nginx/sites-available"
32
+ run "#{sudo} mv /tmp/#{application} /etc/nginx/sites-available/#{application}"
33
+ run "#{sudo} ln -fs /etc/nginx/sites-available/#{application} /etc/nginx/sites-enabled/#{application}"
34
+ else
35
+ run "#{sudo} mv /tmp/#{application} #{nginx_config_path}/#{application}.conf"
36
+ end
29
37
 
30
38
  if nginx_use_ssl
31
- put File.read(nginx_ssl_certificate_local_path), "/tmp/#{nginx_ssl_certificate}"
32
- put File.read(nginx_ssl_certificate_key_local_path), "/tmp/#{nginx_ssl_certificate_key}"
39
+ if nginx_upload_local_certificate
40
+ put File.read(nginx_ssl_certificate_local_path), "/tmp/#{nginx_ssl_certificate}"
41
+ put File.read(nginx_ssl_certificate_key_local_path), "/tmp/#{nginx_ssl_certificate_key}"
33
42
 
34
- run "#{sudo} mv /tmp/#{nginx_ssl_certificate} /etc/ssl/certs/#{nginx_ssl_certificate}"
35
- run "#{sudo} mv /tmp/#{nginx_ssl_certificate_key} /etc/ssl/private/#{nginx_ssl_certificate_key}"
43
+ run "#{sudo} mv /tmp/#{nginx_ssl_certificate} /etc/ssl/certs/#{nginx_ssl_certificate}"
44
+ run "#{sudo} mv /tmp/#{nginx_ssl_certificate_key} /etc/ssl/private/#{nginx_ssl_certificate_key}"
45
+ end
36
46
 
37
47
  run "#{sudo} chown root:root /etc/ssl/certs/#{nginx_ssl_certificate}"
38
48
  run "#{sudo} chown root:root /etc/ssl/private/#{nginx_ssl_certificate_key}"
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module NginxUnicorn
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -18,6 +18,7 @@
18
18
  endscript
19
19
 
20
20
  postrotate
21
- [ ! -f /run/nginx.pid ] || kill -USR1 `cat /run/nginx.pid`
21
+ nginx_pid=<%= nginx_pid %>
22
+ [ ! -f $nginx_pid ] || kill -USR1 `cat $nginx_pid`
22
23
  endscript
23
24
  }
@@ -14,7 +14,9 @@ set -e
14
14
  TIMEOUT=${TIMEOUT-60}
15
15
  APP_ROOT=<%= current_path %>
16
16
  PID=<%= unicorn_pid %>
17
+
17
18
  CMD="cd <%= current_path %>; bundle exec unicorn -D -c <%= unicorn_config %> -E production"
19
+
18
20
  AS_USER=<%= unicorn_user %>
19
21
  set -u
20
22
 
@@ -82,3 +84,4 @@ reopen-logs)
82
84
  exit 1
83
85
  ;;
84
86
  esac
87
+
metadata CHANGED
@@ -1,53 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-nginx-unicorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
4
+ version: 0.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ivan Tkalin
8
+ - Kalys Osmonov
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-11 00:00:00.000000000 Z
12
+ date: 2014-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- prerelease: false
16
15
  name: capistrano
17
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  requirements:
19
- - - ! '>='
18
+ - - ~>
20
19
  - !ruby/object:Gem::Version
21
20
  version: '2.0'
22
- none: false
23
- requirement: !ruby/object:Gem::Requirement
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '2.0'
28
- none: false
29
- type: :runtime
30
28
  - !ruby/object:Gem::Dependency
31
- prerelease: false
32
29
  name: rake
33
- version_requirements: !ruby/object:Gem::Requirement
30
+ requirement: !ruby/object:Gem::Requirement
34
31
  requirements:
35
32
  - - ! '>='
36
33
  - !ruby/object:Gem::Version
37
34
  version: '0'
38
- none: false
39
- requirement: !ruby/object:Gem::Requirement
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
40
38
  requirements:
41
39
  - - ! '>='
42
40
  - !ruby/object:Gem::Version
43
41
  version: '0'
44
- none: false
45
- type: :development
46
- description: Deprecated! Capistrano tasks for configuration and management nginx+unicorn
47
- combo for zero downtime deployments of Rails applications. Configs can be copied
48
- to the application using generators and easily customized.
42
+ description: Capistrano tasks for configuration and management nginx+unicorn combo
43
+ for zero downtime deployments of Rails applications. Configs can be copied to the
44
+ application using generators and easily customized.
49
45
  email:
50
- - itkalin@gmail.com
46
+ - kalys@osmonov.com
51
47
  executables: []
52
48
  extensions: []
53
49
  extra_rdoc_files: []
@@ -67,8 +63,9 @@ files:
67
63
  - lib/generators/capistrano/nginx_unicorn/templates/nginx_conf.erb
68
64
  - lib/generators/capistrano/nginx_unicorn/templates/unicorn.rb.erb
69
65
  - lib/generators/capistrano/nginx_unicorn/templates/unicorn_init.erb
70
- homepage: https://github.com/ivalkeen/capistrano-nginx-unicorn
66
+ homepage: https://github.com/kalys/capistrano-nginx-unicorn
71
67
  licenses: []
68
+ metadata: {}
72
69
  post_install_message:
73
70
  rdoc_options: []
74
71
  require_paths:
@@ -78,23 +75,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
75
  - - ! '>='
79
76
  - !ruby/object:Gem::Version
80
77
  version: '0'
81
- segments:
82
- - 0
83
- hash: 1944416260668696748
84
- none: false
85
78
  required_rubygems_version: !ruby/object:Gem::Requirement
86
79
  requirements:
87
80
  - - ! '>='
88
81
  - !ruby/object:Gem::Version
89
82
  version: '0'
90
- segments:
91
- - 0
92
- hash: 1944416260668696748
93
- none: false
94
83
  requirements: []
95
84
  rubyforge_project:
96
- rubygems_version: 1.8.23
85
+ rubygems_version: 2.1.11
97
86
  signing_key:
98
- specification_version: 3
99
- summary: Deprecated! Create and manage nginx+unicorn configs from capistrano
87
+ specification_version: 4
88
+ summary: Create and manage nginx+unicorn configs from capistrano
100
89
  test_files: []