capistrano-fiftyfive 0.13.0 → 0.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29e3fd7ad4df880bfb2665250d10881d574d9345
4
- data.tar.gz: 248cb2746bed751d9347586fbb0f96ace8c5c6f5
3
+ metadata.gz: 37e7a11ca6da560677e7c92b29fdd9f86c9e282b
4
+ data.tar.gz: 32b016831b52ccf65cad50a5c9c7ce18a18f5674
5
5
  SHA512:
6
- metadata.gz: 33c8160aed2ddc2dfc8f43758e567dc705b5f4e3a16341cfa525af3757c5964100829766b7e30a361f55082f956b7628aa48134f2008883c7612be1157718b65
7
- data.tar.gz: 5aa307f5bc6704fc13db501adeb4567e58fe3ec811e4254c1fdc3f789aba4932691e295f8f377ba2f26febeb9d7da6f03618fd7d9567af4aa063645f6dc60854
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. Requires the highline gem.
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 %>;
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Fiftyfive
3
- VERSION = "0.13.0"
3
+ VERSION = "0.14.0"
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require "digest"
2
+ require "highline"
2
3
  require "monitor"
3
4
  require "capistrano/fiftyfive/version"
4
5
  require "capistrano/fiftyfive/compatibility"
@@ -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
- set_up_secret_prompts
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
- set_up_secret_prompts
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 set_up_secret_prompts
34
- fetch(:fiftyfive_dotenv_keys).each { |k| ask_secretly(k) }
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
- fetch(:fiftyfive_dotenv_monitor).synchronize do
43
- updated << "\n" unless updated.end_with?("\n")
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.13.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-16 00:00:00.000000000 Z
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.4.1
175
+ rubygems_version: 2.2.2
162
176
  signing_key:
163
177
  specification_version: 4
164
178
  summary: Additional Capistrano recipes from 55 Minutes