capistrano-unicorn-nginx 1.0.2 → 2.0.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: 7b24ca75112ef51965b402453911b78ad2464cb7
4
- data.tar.gz: dcf24a353ca4264baeed850c4869b29867ce4b81
3
+ metadata.gz: a719968571f3516541a994ebb85e6ad80d94446f
4
+ data.tar.gz: d0d724977fa49ae5db7538e90db38e79b00bdc54
5
5
  SHA512:
6
- metadata.gz: 9960a5da13b29a0be460ffc64b58b05344b129646771972258f4174a274ff317425d92ecd9ae5ded81922bf50a4180ec9e2ebc13537b1d394f28f6ac7aea55e2
7
- data.tar.gz: 3f67ac584a2ac65d6b85557b36b1ecfe3305405389935e61aba1b9267228a65489675bcd012c8d7d1a8fc35fc21ab293df8cd99b8c0102f4cab35b12243b5787
6
+ metadata.gz: f81d6942cfc03393c79f428268d790e2a6f4c1a9df01355d452d0ba3c0978485142d174aff7b4f75284ca96c252007958fde31c71cc6378ea2935061ce8cb7bb
7
+ data.tar.gz: 8f717e021876d225e375cc867fa9e76957e9006d299327ba1ef9b4c8ca2c00282e8254c2da06812de9b6e70d55f69e122116cf3fd45d203211d1aa95cdc3e7d7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ### v2.0.0, 2014-04-11
2
+ - all the work is moved to the `setup` task
1
3
  ### v1.0.2, 2014-03-30
2
4
  - add `sudo_upload!` helper method for easier uploads
3
5
  - improve the way how templates are handled
@@ -5,5 +7,5 @@
5
7
  - refactor all unicorn and nginx paths to separate modules
6
8
  - speed up `nginx:setup_ssl` task
7
9
  - small README update
8
- ### v1.0.0, 2014-03-39
10
+ ### v1.0.0, 2014-03-29
9
11
  - @bruno- all the v1.0.0 features
data/README.md CHANGED
@@ -30,7 +30,7 @@ Add this to `Gemfile`:
30
30
 
31
31
  group :development do
32
32
  gem 'capistrano', '~> 3.1'
33
- gem 'capistrano-unicorn-nginx'
33
+ gem 'capistrano-unicorn-nginx', '~> 2.0'
34
34
  end
35
35
 
36
36
  And then:
@@ -41,23 +41,39 @@ And then:
41
41
 
42
42
  Add this line to `Capfile`
43
43
 
44
- require 'capistrano/unicorn-nginx'
44
+ require 'capistrano/unicorn_nginx'
45
45
 
46
- If you already have a domain for your app, set `nginx_server_name` in stage
47
- file, example `config/deploy/production.rb`:
46
+ Only if you already have a domain for your app, set `nginx_server_name` in
47
+ stage file, example `config/deploy/production.rb`:
48
48
 
49
49
  set :nginx_server_name, 'mydomain.com'
50
50
 
51
51
  If you don't have a domain yet, you do not have to do anything
52
52
  (`nginx_server_name` will use the default value - server IP).
53
53
 
54
+ **SSL only setup**
55
+
56
+ If you want to setup SSL for your page, add these options to stage file
57
+ (i.e. `config/deploy/production.rb`):
58
+
59
+ # ignore this if you do not need SSL
60
+ set :nginx_use_ssl, true
61
+ set :nginx_ssl_cert_local_path, "/path/to/ssl_cert.crt"
62
+ set :nginx_ssl_cert_key_local_path, "/path/to/ssl_cert.key"
63
+
54
64
  And you're all set!
55
65
 
56
- Execute:
66
+ **Setup task**
57
67
 
58
- $ bundle exec cap deploy production
68
+ Make sure the `deploy_to` path exists and has the right privileges on the
69
+ server (i.e. `/var/www/myapp`).<br/>
70
+ Or just install
71
+ [capistrano-safe-deploy-to](https://github.com/bruno-/capistrano-safe-deploy-to)
72
+ plugin and don't think about it.
59
73
 
60
- and enjoy watching your app being deployed!
74
+ To setup the server for unicorn and nginx, run:
75
+
76
+ $ bundle exec cap production setup
61
77
 
62
78
  ### Configuration
63
79
 
@@ -129,24 +145,30 @@ Number of unicorn workers.
129
145
 
130
146
  ### How it works
131
147
 
132
- `capistrano-unicorn-nginx` integrates seamlessly with the capistrano deploy task.
133
- Here's what happens when you run `bundle exec cap production deploy`:
148
+ Here's what happens when you run `$ bundle exec cap production setup`:
134
149
 
135
150
  **Nginx**
136
151
 
137
- - `after :started, "nginx:setup"`<br/>
138
- Generates and uploads nginx config file. Symlinks config file to `/etc/nginx/sites-enabled`.
139
- - `after :started, "nginx:setup_ssl"`<br/>
140
- Performs SSL related tasks (false by default).
141
- - `after :publishing, "nginx:reload"`<br/>
142
- Reloads nginx.
152
+ - `nginx:setup`<br/>
153
+ Generates and uploads nginx config file. Symlinks config file to
154
+ `/etc/nginx/sites-enabled`.
155
+ - `nginx:setup_ssl`<br/>
156
+ Performs SSL related tasks if `nginx_use_ssl` is true (false by default).
143
157
 
144
158
  **Unicorn**
145
159
 
146
- - `after :updated, "unicorn:setup_initializer"`<br/>
160
+ - `unicorn:setup_initializer`<br/>
147
161
  Uploads unicorn initializer file.
148
- - `after :updated, "unicorn:setup_app_config"`<br/>
162
+ - `unicorn:setup_app_config`<br/>
149
163
  Generates unicorn application config file
164
+
165
+ **Capistrano `deploy` task**
166
+
167
+ This plugin also integrates seamlessly with Capistrano `deploy` task.
168
+ Here's what happens when you run `$ bundle exec cap production deploy`:
169
+
170
+ - `after :publishing, "nginx:reload"`<br/>
171
+ Reloads nginx.
150
172
  - `after :publishing, "unicorn:restart"`<br/>
151
173
  Restarts unicorn after new release.
152
174
 
@@ -66,7 +66,11 @@ namespace :nginx do
66
66
  end
67
67
 
68
68
  namespace :deploy do
69
- after :started, 'nginx:setup'
70
- after :started, 'nginx:setup_ssl'
71
69
  after :publishing, 'nginx:reload'
72
70
  end
71
+
72
+ desc 'Server setup tasks'
73
+ task :setup do
74
+ invoke 'nginx:setup'
75
+ invoke 'nginx:setup_ssl'
76
+ end
@@ -39,6 +39,7 @@ namespace :unicorn do
39
39
  task :setup_app_config do
40
40
  on roles :app do
41
41
  next if file_exists? fetch(:unicorn_config)
42
+ execute :mkdir, '-pv', File.dirname(fetch(:unicorn_config))
42
43
  upload! template('unicorn.rb.erb'), fetch(:unicorn_config)
43
44
  end
44
45
  end
@@ -57,7 +58,11 @@ namespace :unicorn do
57
58
  end
58
59
 
59
60
  namespace :deploy do
60
- after :updated, 'unicorn:setup_initializer'
61
- after :updated, 'unicorn:setup_app_config'
62
61
  after :publishing, 'unicorn:restart'
63
62
  end
63
+
64
+ desc 'Server setup tasks'
65
+ task :setup do
66
+ invoke 'unicorn:setup_initializer'
67
+ invoke 'unicorn:setup_app_config'
68
+ end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module UnicornNginx
3
- VERSION = "1.0.2"
3
+ VERSION = "2.0.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: 1.0.2
4
+ version: 2.0.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-03-30 00:00:00.000000000 Z
11
+ date: 2014-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano