capistrano-fiftyfive 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/capistrano-fiftyfive.gemspec +1 -0
- data/lib/capistrano/fiftyfive/dsl.rb +1 -3
- data/lib/capistrano/fiftyfive/templates/nginx_unicorn.erb +4 -1
- data/lib/capistrano/fiftyfive/version.rb +1 -1
- data/lib/capistrano/fiftyfive.rb +1 -0
- data/lib/capistrano/tasks/defaults.rake +0 -1
- data/lib/capistrano/tasks/dotenv.rake +13 -9
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37e7a11ca6da560677e7c92b29fdd9f86c9e282b
|
4
|
+
data.tar.gz: 32b016831b52ccf65cad50a5c9c7ce18a18f5674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44a70450dbce4ccb4b1797847a7b0af74d01b42f161d243a35c72e3a87ec3cb6e8942698d1c2736ab0056590efe97f59ff4f1107fa9da447ffe42f1d24f3a53b
|
7
|
+
data.tar.gz: f0e5afaee684a66408a9963de88ead097189bb1da6f95f77efaa3f321affe2c69202d8647f611bb9269bc4302e7d556ee641d61eebd0102726407ec039af398a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# capistrano-fiftyfive Changelog
|
2
2
|
|
3
|
+
## `0.14.0`
|
4
|
+
|
5
|
+
* The `highline` gem is now a dependency ([#3](https://github.com/55minutes/capistrano-fiftyfive/pull/3) from [@ahmozkya](https://github.com/ahmozkya)).
|
6
|
+
* Dotenv: only mask input when prompting for keys containing the words "key", "secret", "token", or "password". Input for other keys is echoed for easier data entry.
|
7
|
+
* Dotenv: update `.env` files in sequence rather than in parallel, to avoid parallel command output clobbering the input prompt.
|
8
|
+
* Nginx/unicorn: tweak reverse-proxy cache settings to prevent cache stampede.
|
9
|
+
* Nginx/unicorn: apply far-future expires cache headers only for assets that have fingerprints.
|
10
|
+
|
3
11
|
## `0.13.0`
|
4
12
|
|
5
13
|
The provisioning tasks now work for a non-root user that has password-less sudo privileges. Assuming a user named `matt` that can sudo without being prompted for a password ([instructions here](http://askubuntu.com/questions/192050/how-to-run-sudo-command-with-no-password)), simply modify `deploy.rb` with:
|
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency "capistrano", ">= 3.2.1"
|
25
25
|
spec.add_dependency "sshkit", ">= 1.4.0"
|
26
26
|
spec.add_dependency "colorize"
|
27
|
+
spec.add_dependency "highline"
|
27
28
|
|
28
29
|
spec.add_development_dependency "bundler", "~> 1.3"
|
29
30
|
spec.add_development_dependency "rake"
|
@@ -30,12 +30,11 @@ module Capistrano
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# Like capistrano's built-in ask(), but does not echo user input.
|
33
|
-
# Suitable for passwords, etc.
|
33
|
+
# Suitable for passwords, etc. Uses the highline gem.
|
34
34
|
#
|
35
35
|
# ask_secretly(:postgresql_password)
|
36
36
|
#
|
37
37
|
def ask_secretly(key, default=nil)
|
38
|
-
require "highline"
|
39
38
|
set key, proc{
|
40
39
|
hint = default ? " [#{default}]" : ""
|
41
40
|
answer = HighLine.new.ask("Enter #{key}#{hint}: ") do |q|
|
@@ -46,7 +45,6 @@ module Capistrano
|
|
46
45
|
|
47
46
|
# Delegates to HighLine's agree() method.
|
48
47
|
def agree(yes_or_no_question, character=nil)
|
49
|
-
require "highline"
|
50
48
|
HighLine.new.agree(yes_or_no_question, character)
|
51
49
|
end
|
52
50
|
|
@@ -59,7 +59,7 @@ upstream unicorn_<%= application_basename %> {
|
|
59
59
|
<% end %>
|
60
60
|
|
61
61
|
# Far-future expires and gzip for fingerprinted assets
|
62
|
-
location ^~ /<%= fetch(:assets_prefix, "assets")
|
62
|
+
location ^~ /<%= fetch(:assets_prefix, "assets") %>/.*-[0-9a-f]{32}.* {
|
63
63
|
gzip_static on;
|
64
64
|
expires max;
|
65
65
|
add_header Cache-Control public;
|
@@ -88,7 +88,10 @@ upstream unicorn_<%= application_basename %> {
|
|
88
88
|
proxy_redirect off;
|
89
89
|
|
90
90
|
# enable caching (honors cache-control headers sent by Rails)
|
91
|
+
# lock and use_stale help prevent a cache stampede
|
91
92
|
proxy_cache default;
|
93
|
+
proxy_cache_lock on;
|
94
|
+
proxy_cache_use_stale updating;
|
92
95
|
add_header X-Cache-Status $upstream_cache_status;
|
93
96
|
|
94
97
|
proxy_pass http://unicorn_<%= application_basename %>;
|
data/lib/capistrano/fiftyfive.rb
CHANGED
@@ -35,7 +35,6 @@ namespace :load do
|
|
35
35
|
set :fiftyfive_delayed_job_script, "bin/delayed_job"
|
36
36
|
|
37
37
|
set :fiftyfive_dotenv_keys, %w(rails_secret_key_base postmark_api_key)
|
38
|
-
set :fiftyfive_dotenv_monitor, Monitor.new
|
39
38
|
set :fiftyfive_dotenv_filename, -> { ".env.#{fetch(:rails_env)}" }
|
40
39
|
|
41
40
|
set :fiftyfive_log_file, "log/capistrano.log"
|
@@ -7,7 +7,7 @@ namespace :fiftyfive do
|
|
7
7
|
namespace :dotenv do
|
8
8
|
desc "Replace/create .env file with values provided at console"
|
9
9
|
task :replace do
|
10
|
-
|
10
|
+
set_up_prompts
|
11
11
|
|
12
12
|
on release_roles(:all) do
|
13
13
|
update_dotenv_file
|
@@ -16,9 +16,9 @@ namespace :fiftyfive do
|
|
16
16
|
|
17
17
|
desc "Update .env file with any missing values"
|
18
18
|
task :update do
|
19
|
-
|
19
|
+
set_up_prompts
|
20
20
|
|
21
|
-
on release_roles(:all) do
|
21
|
+
on release_roles(:all), :in => :sequence do
|
22
22
|
existing_env = if test("[ -f #{shared_dotenv_path} ]")
|
23
23
|
download!(shared_dotenv_path)
|
24
24
|
end
|
@@ -30,8 +30,14 @@ namespace :fiftyfive do
|
|
30
30
|
"#{shared_path}/#{fetch(:fiftyfive_dotenv_filename)}"
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
fetch(:fiftyfive_dotenv_keys).each
|
33
|
+
def set_up_prompts
|
34
|
+
fetch(:fiftyfive_dotenv_keys).each do |key|
|
35
|
+
if key.to_s =~ /key|token|secret|password/i
|
36
|
+
ask_secretly(key)
|
37
|
+
else
|
38
|
+
ask(key, nil)
|
39
|
+
end
|
40
|
+
end
|
35
41
|
end
|
36
42
|
|
37
43
|
def update_dotenv_file(existing="")
|
@@ -39,10 +45,8 @@ namespace :fiftyfive do
|
|
39
45
|
|
40
46
|
fetch(:fiftyfive_dotenv_keys).each do |key|
|
41
47
|
next if existing =~ /^#{Regexp.escape(key.upcase)}=/
|
42
|
-
|
43
|
-
|
44
|
-
updated << "#{key.upcase}=#{fetch(key)}\n"
|
45
|
-
end
|
48
|
+
updated << "\n" unless updated.end_with?("\n")
|
49
|
+
updated << "#{key.upcase}=#{fetch(key)}\n"
|
46
50
|
end
|
47
51
|
|
48
52
|
unless existing == updated
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-fiftyfive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brictson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: highline
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
172
|
version: '0'
|
159
173
|
requirements: []
|
160
174
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
175
|
+
rubygems_version: 2.2.2
|
162
176
|
signing_key:
|
163
177
|
specification_version: 4
|
164
178
|
summary: Additional Capistrano recipes from 55 Minutes
|