capistrano-nginx-unicorn 0.1.0.pre → 0.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 +13 -5
- data/README.md +43 -50
- data/lib/capistrano/nginx_unicorn/defaults.rb +0 -1
- data/lib/capistrano/nginx_unicorn/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ODQwZDJjZTE0Mzk3NGIwMjZlMzhjNzY3MGY5YzY3MTNiZjE4MzU0Ng==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MTc1MTZiZTRmN2NhNjRmMDFjZDEzNjc0ZWIzODFhM2EyZWYxMDkzNg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjYxOTEzYjcwM2NiYWFkYjEzYzNjZTFlYmZmZWNmNWY0MGIyM2ZhZmY5NDA4
|
10
|
+
YzkwOWNhZTM2MTg1Mjg5ZTk2ZjQzZDI2NzgyN2RmODAyMmVmM2U2Y2FmMDg2
|
11
|
+
ZjZkNmE5ODJhOGFlNTdhZDc0NzA2YTA2ZWQ3MGUzMGZlNzdlOGQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjA4ODNlMTc1YmM2NWIzMjdhZGRhNzQwNGMzMzhmZGFlNjk1Zjg5YmI5ZDRh
|
14
|
+
ODFkNDQ1YzZlZTgyYjcyNmE2MzAyNmUzMGQ5MTc2NTgzY2Q3NzE4NDI2Njg2
|
15
|
+
YmVmNzgwZGY4OWVlMjE1MDA4ODE1YzJhZTkwZWY0N2VkMzMxNjY=
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ Also, for full customization, all configs can be copied to the application using
|
|
17
17
|
|
18
18
|
Add this line to your application's Gemfile:
|
19
19
|
|
20
|
-
gem 'capistrano-nginx-unicorn',
|
20
|
+
gem 'capistrano-nginx-unicorn', group: :development
|
21
21
|
|
22
22
|
And then execute:
|
23
23
|
|
@@ -29,16 +29,9 @@ Or install it yourself as:
|
|
29
29
|
|
30
30
|
## Usage
|
31
31
|
|
32
|
-
Add this line to your `
|
32
|
+
Add this line to your `Capfile`
|
33
33
|
|
34
|
-
require 'capistrano
|
35
|
-
|
36
|
-
Note, that following capistrano variables should be defined:
|
37
|
-
|
38
|
-
application
|
39
|
-
current_path
|
40
|
-
shared_path
|
41
|
-
user
|
34
|
+
require 'capistrano/nginx_unicorn'
|
42
35
|
|
43
36
|
You can check that new tasks are available (`cap -T`):
|
44
37
|
|
@@ -47,13 +40,19 @@ for nginx:
|
|
47
40
|
# add and enable application to nginx
|
48
41
|
cap nginx:setup
|
49
42
|
|
43
|
+
# upload ssl certificates
|
44
|
+
cap nginx:setup_ssl
|
45
|
+
|
50
46
|
# reload nginx configuration
|
51
47
|
cap nginx:reload
|
52
48
|
|
53
49
|
and for unicorn:
|
54
50
|
|
55
|
-
# create unicorn
|
56
|
-
cap unicorn:
|
51
|
+
# create unicorn init script
|
52
|
+
cap unicorn:setup_initializer
|
53
|
+
|
54
|
+
# create unicorn configuration file
|
55
|
+
cap unicorn:setup_app_config
|
57
56
|
|
58
57
|
# start unicorn
|
59
58
|
cap unicorn:start
|
@@ -69,20 +68,10 @@ and for unicorn:
|
|
69
68
|
and shared:
|
70
69
|
|
71
70
|
# create logrotate record to rotate application logs
|
72
|
-
cap logrotate
|
73
|
-
|
74
|
-
There is no need to execute any of these tasks manually.
|
75
|
-
They will be called automatically on different deploy stages:
|
76
|
-
|
77
|
-
* `nginx:setup`, `nginx:reload`, `unicorn:setup` and `logrotate` are hooked to `deploy:setup`
|
78
|
-
* `unicorn:restart` is hooked to `deploy:restart`
|
71
|
+
cap logrotate:setup
|
79
72
|
|
80
|
-
|
81
|
-
nginx
|
82
|
-
And after each deploy, unicorn will be automatically reloaded.
|
83
|
-
|
84
|
-
However, if you changed variables or customized templates,
|
85
|
-
you can run any of these tasks to update configuration.
|
73
|
+
### Hooks
|
74
|
+
`nginx:reload`, `unicorn:restart` are hooked to `deploy:publishing`
|
86
75
|
|
87
76
|
## Customization
|
88
77
|
|
@@ -91,40 +80,20 @@ you can run any of these tasks to update configuration.
|
|
91
80
|
You can customize nginx and unicorn configs using capistrano variables:
|
92
81
|
|
93
82
|
|
94
|
-
```
|
83
|
+
```
|
95
84
|
# path to customized templates (see below for details)
|
96
85
|
# default value: "config/deploy/templates"
|
97
86
|
set :templates_path, "config/deploy/templates"
|
98
87
|
|
99
|
-
# server name for nginx, default value:
|
88
|
+
# server name for nginx, default value: "localhost <application>.local"
|
100
89
|
# set this to your site name as it is visible from outside
|
101
90
|
# this will allow 1 nginx to serve several sites with different `server_name`
|
102
91
|
set :nginx_server_name, "example.com"
|
103
92
|
|
104
|
-
# path, where unicorn pid file will be stored
|
105
|
-
# default value: `"#{current_path}/tmp/pids/unicorn.pid"`
|
106
|
-
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
|
107
|
-
|
108
93
|
# path, where nginx pid file will be stored (used in logrotate recipe)
|
109
94
|
# default value: `"/run/nginx.pid"`
|
110
95
|
set :nginx_pid, "/run/nginx.pid"
|
111
96
|
|
112
|
-
# path, where unicorn config file will be stored
|
113
|
-
# default value: `"#{shared_path}/config/unicorn.rb"`
|
114
|
-
set :unicorn_config, "#{shared_path}/config/unicorn.rb"
|
115
|
-
|
116
|
-
# path, where unicorn log file will be stored
|
117
|
-
# default value: `"#{shared_path}/config/unicorn.rb"`
|
118
|
-
set :unicorn_log, "#{shared_path}/config/unicorn.rb"
|
119
|
-
|
120
|
-
# user name to run unicorn
|
121
|
-
# default value: `user` (user varibale defined in your `deploy.rb`)
|
122
|
-
set :unicorn_user, "user"
|
123
|
-
|
124
|
-
# number of unicorn workers
|
125
|
-
# default value: no (will be prompted if not set)
|
126
|
-
set :unicorn_workers, 4
|
127
|
-
|
128
97
|
# if set, nginx will be configured to 443 port and port 80 will be auto rewritten to 443
|
129
98
|
# also, on `nginx:setup`, paths to ssl certificate and key will be configured
|
130
99
|
# and certificate file and key will be copied to `/etc/ssl/certs` and `/etc/ssl/private/` directories
|
@@ -143,6 +112,31 @@ set :nginx_ssl_certificate, "#{nginx_server_name}.crt"
|
|
143
112
|
# default value: `nginx_server_name + ".key"`
|
144
113
|
set :nginx_ssl_certificate_key, "#{nginx_server_name}.key"
|
145
114
|
|
115
|
+
# nginx config file location
|
116
|
+
# centos users can set `/etc/nginx/conf.d`
|
117
|
+
# default value: `/etc/nginx/sites-available`
|
118
|
+
set :nginx_config_path, "/etc/nginx/sites-available"
|
119
|
+
|
120
|
+
# path, where unicorn pid file will be stored
|
121
|
+
# default value: `"#{current_path}/tmp/pids/unicorn.pid"`
|
122
|
+
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
|
123
|
+
|
124
|
+
# path, where unicorn config file will be stored
|
125
|
+
# default value: `"#{shared_path}/config/unicorn.rb"`
|
126
|
+
set :unicorn_config, "#{shared_path}/config/unicorn.rb"
|
127
|
+
|
128
|
+
# path, where unicorn log file will be stored
|
129
|
+
# default value: `"#{shared_path}/config/unicorn.rb"`
|
130
|
+
set :unicorn_log, "#{shared_path}/config/unicorn.rb"
|
131
|
+
|
132
|
+
# user name to run unicorn
|
133
|
+
# default value: `user` (user varibale defined in your `deploy.rb`)
|
134
|
+
set :unicorn_user, "user"
|
135
|
+
|
136
|
+
# number of unicorn workers
|
137
|
+
# default value: 2
|
138
|
+
set :unicorn_workers, 2
|
139
|
+
|
146
140
|
# local path to file with certificate, only makes sense if `nginx_use_ssl` is set
|
147
141
|
# this file will be copied to remote server
|
148
142
|
# default value: none (will be prompted if not set)
|
@@ -154,13 +148,12 @@ set :nginx_ssl_certificate_local_path, "/home/ivalkeen/ssl/myssl.cert"
|
|
154
148
|
set :nginx_ssl_certificate_key_local_path, "/home/ivalkeen/ssl/myssl.key"
|
155
149
|
```
|
156
150
|
|
157
|
-
For example, of you site name is `example.com` and you want to use
|
151
|
+
For example, of you site name is `example.com` and you want to use 4 unicorn workers,
|
158
152
|
your `deploy.rb` will look like this:
|
159
153
|
|
160
154
|
```ruby
|
161
|
-
set :
|
155
|
+
set :nginx_server_name, "example.com"
|
162
156
|
set :unicorn_workers, 4
|
163
|
-
require 'capistrano-nginx-unicorn'
|
164
157
|
```
|
165
158
|
|
166
159
|
### Template Customization
|
@@ -11,7 +11,6 @@ set :nginx_ssl_certificate_key_local_path, -> { ask(:nginx_ssl_certificate_key_l
|
|
11
11
|
set :nginx_config_path, "/etc/nginx/sites-available"
|
12
12
|
|
13
13
|
set :unicorn_service_name, -> { "unicorn_#{fetch(:application)}_#{fetch(:stage)}" }
|
14
|
-
set :templates_path, "config/deploy/templates"
|
15
14
|
set :unicorn_pid, -> { shared_path.join("pids/unicorn.pid") }
|
16
15
|
set :unicorn_config, -> { shared_path.join("config/unicorn.rb") }
|
17
16
|
set :unicorn_log, -> { shared_path.join("log/unicorn.log") }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-nginx-unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Tkalin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -29,14 +29,14 @@ dependencies:
|
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - '>='
|
32
|
+
- - ! '>='
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - '>='
|
39
|
+
- - ! '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
description: Capistrano tasks for configuration and management nginx+unicorn combo
|
@@ -78,14 +78,14 @@ require_paths:
|
|
78
78
|
- lib
|
79
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - '>='
|
81
|
+
- - ! '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- - '
|
86
|
+
- - ! '>='
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
91
|
rubygems_version: 2.1.11
|