capistrano-fiftyfive 0.11.1 → 0.12.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/capistrano/fiftyfive/console.rb +5 -3
- data/lib/capistrano/fiftyfive/templates/nginx.erb +4 -0
- data/lib/capistrano/fiftyfive/templates/nginx_unicorn.erb +4 -0
- data/lib/capistrano/fiftyfive/version.rb +1 -1
- data/lib/sshkit/formatter/abbreviated.rb +29 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdbde2f4fccd4d71cee322fa44e5b0efc0b8e7f8
|
4
|
+
data.tar.gz: c1f3b4f97aaa954f5f12ffdb3dc0b15cf001effa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 344a1b1348883651726eb448779a35db61697d0925c856f178d5370ff8894c65b30ab28c1a3249a76f3c6eb84e751575e91b62bb6a557c95c6b92e8ebfe939d3
|
7
|
+
data.tar.gz: 6fbc01f6072e72f639542c294d9e613446de66118840992bee2b6d56bcc0ce4156c088ef344b21017f2a1c4d6847fcfd3ed93a282ba1189a8b8ac4113d39fd89
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# capistrano-fiftyfive Changelog
|
2
2
|
|
3
|
+
## `0.12.0`
|
4
|
+
|
5
|
+
* capistrano-fiftyfive's abbreviated format now honors the new `SSHKIT_COLOR` environment variable. Set `SSHKIT_COLOR=1` to force ANSI color even on non-ttys (e.g. Jenkins).
|
6
|
+
* The generated nginx config now enables reverse proxy caching by default.
|
7
|
+
* INFO messages printed by sshkit are now printed to console under the appropriate rake task heading.
|
8
|
+
|
3
9
|
## `0.11.1`
|
4
10
|
|
5
11
|
Fixes errors caused by PostgreSQL password containing shell-unsafe characters. Passwords are now safely hashed with MD5 before being used in the `CREATE USER` command.
|
@@ -15,13 +15,15 @@ module Capistrano
|
|
15
15
|
|
16
16
|
# Writes to the IO after first truncating the output to fit the console
|
17
17
|
# width. If the underlying IO is not a TTY, ANSI colors are removed from
|
18
|
-
# the output. A newline is always added.
|
18
|
+
# the output. A newline is always added. Color output can be forced by
|
19
|
+
# setting the SSHKIT_COLOR environment variable.
|
19
20
|
def print_line(obj)
|
20
21
|
string = obj.to_s
|
21
22
|
|
22
|
-
if
|
23
|
+
if console_width
|
23
24
|
string = truncate_to_console_width(string)
|
24
|
-
|
25
|
+
end
|
26
|
+
unless ENV["SSHKIT_COLOR"] || @output.tty?
|
25
27
|
string = strip_ascii_color(string)
|
26
28
|
end
|
27
29
|
|
@@ -32,6 +32,10 @@ http {
|
|
32
32
|
# Unicorn nor Rainbows! is optimized for it at the moment
|
33
33
|
sendfile on;
|
34
34
|
|
35
|
+
# configure reverse proxy cache
|
36
|
+
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=default:8m max_size=1000m inactive=30d;
|
37
|
+
proxy_temp_path /var/cache/nginx/tmp;
|
38
|
+
|
35
39
|
tcp_nopush on; # off may be better for *some* Comet/long-poll stuff
|
36
40
|
tcp_nodelay off; # on may be better for some Comet/long-poll stuff
|
37
41
|
|
@@ -87,6 +87,10 @@ upstream unicorn_<%= application_basename %> {
|
|
87
87
|
# redirects, we set the Host: header above already.
|
88
88
|
proxy_redirect off;
|
89
89
|
|
90
|
+
# enable caching (honors cache-control headers sent by Rails)
|
91
|
+
proxy_cache default;
|
92
|
+
add_header X-Cache-Status $upstream_cache_status;
|
93
|
+
|
90
94
|
proxy_pass http://unicorn_<%= application_basename %>;
|
91
95
|
}
|
92
96
|
|
@@ -64,20 +64,19 @@ module SSHKit
|
|
64
64
|
|
65
65
|
def write_log_message(log_message)
|
66
66
|
return unless log_message.verbosity >= SSHKit::Logger::INFO
|
67
|
+
print_task_if_changed
|
67
68
|
@console.print_line(light_black(" " + log_message.to_s))
|
68
69
|
end
|
69
70
|
|
70
71
|
def write_command(command)
|
71
72
|
return unless command.verbosity > SSHKit::Logger::DEBUG
|
72
73
|
|
74
|
+
print_task_if_changed
|
75
|
+
|
73
76
|
ctx = context_for_command(command)
|
74
77
|
number = '%02d' % ctx.number
|
75
78
|
|
76
79
|
if ctx.first_execution?
|
77
|
-
if ctx.first_command_of_task?
|
78
|
-
print_line "#{clock} #{blue(ctx.task)}"
|
79
|
-
end
|
80
|
-
|
81
80
|
description = yellow(ctx.shell_string)
|
82
81
|
print_line " #{number} #{description}"
|
83
82
|
end
|
@@ -88,9 +87,33 @@ module SSHKit
|
|
88
87
|
end
|
89
88
|
end
|
90
89
|
|
91
|
-
def
|
90
|
+
def print_task_if_changed
|
91
|
+
status = current_task_status
|
92
|
+
|
93
|
+
if status.changed
|
94
|
+
print_line "#{clock} #{blue(status.task)}"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def current_task_status
|
92
99
|
task = self.class.current_rake_task.to_s
|
93
|
-
|
100
|
+
if @tasks[task]
|
101
|
+
changed = false
|
102
|
+
else
|
103
|
+
changed = true
|
104
|
+
@tasks[task] = []
|
105
|
+
end
|
106
|
+
|
107
|
+
OpenStruct.new(
|
108
|
+
:task => task,
|
109
|
+
:commands => @tasks[task],
|
110
|
+
:changed => changed
|
111
|
+
)
|
112
|
+
end
|
113
|
+
|
114
|
+
def context_for_command(command)
|
115
|
+
status = current_task_status
|
116
|
+
task_commands = status.commands
|
94
117
|
|
95
118
|
shell_string = command.to_s.sub(%r(^/usr/bin/env ), "")
|
96
119
|
|
@@ -105,9 +128,7 @@ module SSHKit
|
|
105
128
|
|
106
129
|
OpenStruct.new({
|
107
130
|
:first_execution? => first_execution,
|
108
|
-
:first_command_of_task? => (number == 1),
|
109
131
|
:number => number,
|
110
|
-
:task => task,
|
111
132
|
:shell_string => shell_string
|
112
133
|
})
|
113
134
|
end
|
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.12.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-
|
11
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|