sshkit 1.18.1 → 1.21.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.
data/.travis.yml CHANGED
@@ -6,6 +6,9 @@ rvm:
6
6
  - 2.2
7
7
  - 2.1
8
8
  - 2.0
9
+ branches:
10
+ only:
11
+ - master
9
12
  matrix:
10
13
  include:
11
14
  # Run Danger only once, on 2.5
data/CHANGELOG.md CHANGED
@@ -1,774 +1 @@
1
- ## Changelog
2
-
3
- This file is written in reverse chronological order, newer releases will
4
- appear at the top.
5
-
6
- ## [Unreleased][]
7
-
8
- * Your contribution here!
9
-
10
- ## [1.18.1][] (2019-01-26)
11
-
12
- * [#447](https://github.com/capistrano/sshkit/pull/447): Fix broken thread safety by widening critical section - [Takumasa Ochi](https://github.com/aeroastro)
13
-
14
- ## [1.18.0][] (2018-10-21)
15
-
16
- * [#435](https://github.com/capistrano/sshkit/pull/435): Consistent verbosity configuration #capture and #test methods - [@NikolayRys](https://github.com/NikolayRys)
17
-
18
- ## [1.17.0][] (2018-07-07)
19
-
20
- * [#430](https://github.com/capistrano/sshkit/pull/430): [Feature] Command Argument STDOUT/capistrano.log Hiding - [@NorseGaud](https://github.com/NorseGaud)
21
-
22
- ## [1.16.1][] (2018-05-20)
23
-
24
- * [#425](https://github.com/capistrano/sshkit/pull/425): Command#group incorrectly escapes double quotes, resulting in a a syntax error when specifying the group execution using `as`. This issue manifested when user command quotes changed from double quotes to single quotes. This fix removes the double quote escaping - [@pblesi](https://github.com/pblesi).
25
-
26
- ## [1.16.0][] (2018-02-03)
27
-
28
- * [#417](https://github.com/capistrano/sshkit/pull/417): Cache key generation for connections becomes slow when `known_hosts` is a valid `net/ssh` options and `known_hosts` file is big. This changes the cache key generation and fixes performance issue - [@ElvinEfendi](https://github.com/ElvinEfendi).
29
-
30
- ## [1.15.1][] (2017-11-18)
31
-
32
- This is a small bug-fix release that fixes problems with `upload!` and `download!` that were inadvertently introduced in 1.15.0.
33
-
34
- ### Breaking changes
35
-
36
- * None
37
-
38
- ### Bug fixes
39
-
40
- * [#410](https://github.com/capistrano/sshkit/pull/410): fix NoMethodError when using upload!/download! with Pathnames - [@UnderpantsGnome](https://github.com/UnderpantsGnome)
41
- * [#411](https://github.com/capistrano/sshkit/pull/410): fix upload!/download! when using relative paths outside of `within` blocks - [@Fjan](https://github.com/Fjan)
42
-
43
- ## [1.15.0][] (2017-11-03)
44
-
45
- ### New features
46
-
47
- * [#408](https://github.com/capistrano/sshkit/pull/408): upload! and download! now respect `within` - [@sj26](https://github.com/sj26)
48
-
49
- ### Potentially breaking changes
50
-
51
- * `upload!` and `download!` now support remote paths which are
52
- relative to the `within` working directory. They were previously documented
53
- as only supporting absolute paths, but relative paths still worked relative
54
- to the remote working directory. If you rely on the previous behaviour you
55
- may need to adjust your code.
56
-
57
- ## [1.14.0][] (2017-06-30)
58
-
59
- ### Breaking changes
60
-
61
- * None
62
-
63
- ### New features
64
-
65
- * [#401](https://github.com/capistrano/sshkit/pull/401): Add :log_percent option to specify upload!/download! transfer log percentage - [@aubergene](https://github.com/aubergene)
66
-
67
- ## [1.13.1][] (2017-03-31)
68
-
69
- ### Breaking changes
70
-
71
- * None
72
-
73
- ### Bug fixes
74
-
75
- * [#397](https://github.com/capistrano/sshkit/pull/397): Fix NoMethodError assign_defaults with net-ssh older than 4.0.0 - [@shirosaki](https://github.com/shirosaki)
76
-
77
- ## [1.13.0][] (2017-03-24)
78
-
79
- ### Breaking changes
80
-
81
- * None
82
-
83
- ### New features
84
-
85
- * [#372](https://github.com/capistrano/sshkit/pull/372): Use cp_r in local backend with recursive option - [@okuramasafumi](https://github.com/okuramasafumi)
86
-
87
- ### Bug fixes
88
-
89
- * [#390](https://github.com/capistrano/sshkit/pull/390): Properly wrap Ruby StandardError w/ add'l context - [@mattbrictson](https://github.com/mattbrictson)
90
- * [#392](https://github.com/capistrano/sshkit/pull/392): Fix open two connections with changed cache key - [@shirosaki](https://github.com/shirosaki)
91
-
92
- ## [1.12.0][] (2017-02-10)
93
-
94
- ### Breaking changes
95
-
96
- * None
97
-
98
- ### New features
99
-
100
- * Add `SSHKit.config.default_runner_config` option that allows overriding default runner configs.
101
-
102
- ## [1.11.5][] (2016-12-16)
103
-
104
- ### Bug fixes
105
-
106
- * Do not prefix `exec` command
107
- [PR #378](https://github.com/capistrano/sshkit/pull/378) @dreyks
108
-
109
- ## [1.11.4][] (2016-11-02)
110
-
111
- * Use string interpolation for environment variables to avoid escaping issues
112
- with sprintf
113
- [PR #280](https://github.com/capistrano/sshkit/pull/280)
114
- @Sinjo - Chris Sinjakli
115
-
116
- ## [1.11.3][] (2016-09-16)
117
-
118
- * Fix known_hosts caching to match on the entire hostlist
119
- [PR #364](https://github.com/capistrano/sshkit/pull/364) @byroot
120
-
121
- ## [1.11.2][] (2016-07-29)
122
-
123
- ### Bug fixes
124
-
125
- * Fixed a crash occurring when `Host@keys` was set to a non-Enumerable.
126
- @xavierholt [PR #360](https://github.com/capistrano/sshkit/pull/360)
127
-
128
- ## [1.11.1][] (2016-06-17)
129
-
130
- ### Bug fixes
131
-
132
- * Fixed a regression in 1.11.0 that would cause
133
- `ArgumentError: invalid option(s): known_hosts` in some older versions of
134
- net-ssh. @byroot [#357](https://github.com/capistrano/sshkit/issues/357)
135
-
136
- ## [1.11.0][] (2016-06-14)
137
-
138
- ### Bug fixes
139
-
140
- * Fixed colorized output alignment in Logger::Pretty. @xavierholt
141
- [PR #349](https://github.com/capistrano/sshkit/pull/349)
142
- * Fixed a bug that prevented nested `with` calls
143
- [#43](https://github.com/capistrano/sshkit/issues/43)
144
-
145
- ### Other changes
146
-
147
- * Known hosts lookup optimization is now enabled by default. @byroot
148
-
149
- ## 1.10.0 (2016-04-22)
150
-
151
- * You can now opt-in to caching of SSH's known_hosts file for a speed boost
152
- when deploying to a large fleet of servers. Refer to the
153
- [README](https://github.com/capistrano/sshkit/tree/v1.10.0#known-hosts-caching) for
154
- details. We plan to turn this on by default in a future version of SSHKit.
155
- [PR #330](https://github.com/capistrano/sshkit/pull/330) @byroot
156
- * SSHKit now explicitly closes its pooled SSH connections when Ruby exits;
157
- this fixes `zlib(finalizer): the stream was freed prematurely` warnings
158
- [PR #343](https://github.com/capistrano/sshkit/pull/343) @mattbrictson
159
- * Allow command map entries (`SSHKit::CommandMap#[]`) to be Procs
160
- [PR #310](https://github.com/capistrano/sshkit/pull/310)
161
- @mikz
162
-
163
- ## 1.9.0
164
-
165
- **Refer to the 1.9.0.rc1 release notes for a full list of new features, fixes,
166
- and potentially breaking changes since SSHKit 1.8.1.** There are no changes
167
- since 1.9.0.rc1.
168
-
169
- ## 1.9.0.rc1
170
-
171
- ### Potentially breaking changes
172
-
173
- * The SSHKit DSL is no longer automatically included when you `require` it.
174
- **This means you must now explicitly `include SSHKit::DSL`.**
175
- See [PR #219](https://github.com/capistrano/sshkit/pull/219) for details.
176
- @beatrichartz
177
- * `SSHKit::Backend::Printer#test` now always returns true
178
- [PR #312](https://github.com/capistrano/sshkit/pull/312) @mikz
179
-
180
- ### New features
181
-
182
- * `SSHKit::Formatter::Abstract` now accepts an optional Hash of options
183
- [PR #308](https://github.com/capistrano/sshkit/pull/308) @mattbrictson
184
- * Add `SSHKit::Backend.current` so that Capistrano plugin authors can refactor
185
- helper methods and still have easy access to the currently-executing Backend
186
- without having to use global variables.
187
- * Add `SSHKit.config.default_runner` options that allows to override default command runner.
188
- This option also accepts a name of the custom runner class.
189
- * The ConnectionPool has been rewritten in this release to be more efficient
190
- and have a cleaner internal API. You can still completely disable the pool
191
- by setting `SSHKit::Backend::Netssh.pool.idle_timeout = 0`.
192
- @mattbrictson @byroot [PR #328](https://github.com/capistrano/sshkit/pull/328)
193
-
194
- ### Bug fixes
195
-
196
- * make sure working directory for commands is properly cleared after `within` blocks
197
- [PR #307](https://github.com/capistrano/sshkit/pull/307)
198
- @steved
199
- * display more accurate string for commands with spaces being output in `Formatter::Pretty`
200
- [PR #304](https://github.com/capistrano/sshkit/pull/304)
201
- @steved
202
- [PR #319](https://github.com/capistrano/sshkit/pull/319) @mattbrictson
203
- * Fix a race condition experienced in JRuby that could cause multi-server
204
- deploys to fail. [PR #322](https://github.com/capistrano/sshkit/pull/322)
205
- @mattbrictson
206
-
207
- ## 1.8.1
208
-
209
- * Change license to MIT, thanks to all the patient contributors who gave
210
- their permissions.
211
-
212
- ## 1.8.0
213
-
214
- * add SSHKit::Backend::ConnectionPool#close_connections
215
- [PR #285](https://github.com/capistrano/sshkit/pull/285)
216
- @akm
217
- * Clean up rubocop lint warnings
218
- [PR #275](https://github.com/capistrano/sshkit/pull/275)
219
- @cshaffer
220
- * Prepend unused parameter names with an underscore
221
- * Prefer “safe assignment in condition”
222
- * Disambiguate regexp literals with parens
223
- * Prefer `sprintf` over `String#%`
224
- * No longer shadow `caller_line` variable in `DeprecationLogger`
225
- * Rescue `StandardError` instead of `Exception`
226
- * Remove useless `private` access modifier in `TestAbstract`
227
- * Disambiguate block operator with parens
228
- * Disambiguate between grouped expression and method params
229
- * Remove assertion in `TestHost#test_assert_hosts_compare_equal` that compares something with itself
230
- * Export environment variables and execute command in a subshell.
231
- [PR #273](https://github.com/capistrano/sshkit/pull/273)
232
- @kuon
233
- * Introduce `log_command_start`, `log_command_data`, `log_command_exit` methods on `Formatter`
234
- [PR #257](https://github.com/capistrano/sshkit/pull/257)
235
- @robd
236
- * Deprecate `@stdout` and `@stderr` accessors on `Command`
237
- * Add support for deprecation logging options.
238
- [README](README.md#deprecation-warnings),
239
- [PR #258](https://github.com/capistrano/sshkit/pull/258)
240
- @robd
241
- * Quote environment variable values.
242
- [PR #250](https://github.com/capistrano/sshkit/pull/250)
243
- @Sinjo - Chris Sinjakli
244
- * Simplified formatter hierarchy.
245
- [PR #248](https://github.com/capistrano/sshkit/pull/248)
246
- @robd
247
- * `SimpleText` formatter now extends `Pretty`, rather than duplicating.
248
- * Hide ANSI color escape sequences when outputting to a file.
249
- [README](README.md#output-colors),
250
- [Issue #245](https://github.com/capistrano/sshkit/issues/245),
251
- [PR #246](https://github.com/capistrano/sshkit/pull/246)
252
- @robd
253
- * Now only color the output if it is associated with a tty,
254
- or the `SSHKIT_COLOR` environment variable is set.
255
- * Removed broken support for assigning an `IO` to the `output` config option.
256
- [Issue #243](https://github.com/capistrano/sshkit/issues/243),
257
- [PR #244](https://github.com/capistrano/sshkit/pull/244)
258
- @robd
259
- * Use `SSHKit.config.output = SSHKit::Formatter::SimpleText.new($stdin)` instead
260
- * Added support for `:interaction_handler` option on commands.
261
- [PR #234](https://github.com/capistrano/sshkit/pull/234),
262
- [PR #242](https://github.com/capistrano/sshkit/pull/242)
263
- @robd
264
- * Removed partially supported `TRACE` log level.
265
- [2aa7890](https://github.com/capistrano/sshkit/commit/2aa78905f0c521ad9f697e7a4ed04ba438d5ee78)
266
- @robd
267
- * Add support for the `:strip` option to the `capture` method and strip by default on the `Local` backend.
268
- [PR #239](https://github.com/capistrano/sshkit/pull/239),
269
- [PR #249](https://github.com/capistrano/sshkit/pull/249)
270
- @robd
271
- * The `Local` backend now strips by default to be consistent with the `Netssh` one.
272
- * This reverses change [7d15a9a](https://github.com/capistrano/sshkit/commit/7d15a9aebfcc43807c8151bf6f3a4bc038ce6218) to the `Local` capture API to remove stripping by default.
273
- * If you require the raw, unstripped output, pass the `strip: false` option: `capture(:ls, strip: false)`
274
- * Simplified backend hierarchy.
275
- [PR #235](https://github.com/capistrano/sshkit/pull/235),
276
- [PR #237](https://github.com/capistrano/sshkit/pull/237)
277
- @robd
278
- * Moved duplicate implementations of `make`, `rake`, `test`, `capture`, `background` on to `Abstract` backend.
279
- * Backend implementations now only need to implement `execute_command`, `upload!` and `download!`
280
- * Removed `Printer` from backend hierarchy for `Local` and `Netssh` backends (they now just extend `Abstract`)
281
- * Removed unused `Net::SSH:LogLevelShim`
282
- * Removed dependency on the `colorize` gem. SSHKit now implements its own ANSI color logic, with no external dependencies. Note that SSHKit now only supports the `:bold` or plain modes. Other modes will be gracefully ignored. [#263](https://github.com/capistrano/sshkit/issues/263)
283
- * New API for setting the formatter: `use_format`. This differs from `format=` in that it accepts options or arguments that will be passed to the formatter's constructor. The `format=` syntax will be deprecated in a future release. [#295](https://github.com/capistrano/sshkit/issues/295)
284
- * SSHKit now immediately raises a `NameError` if you try to set a formatter that does not exist. [#295](https://github.com/capistrano/sshkit/issues/295)
285
- * Fix error message when the formatter does not exist. [#301](https://github.com/capistrano/sshkit/pull/301)
286
-
287
- ## 1.7.1
288
-
289
- * Fix a regression in 1.7.0 that caused command completion messages to be removed from log output. @mattbrictson
290
-
291
- ## 1.7.0
292
-
293
- * Update Vagrantfile to use multi-provider Hashicorp precise64 box - remove URLs. @townsen
294
- * Merge host ssh_options and Netssh defaults @townsen
295
- Previously if host-level ssh_options were defined the Netssh defaults
296
- were ignored.
297
- * Merge host ssh_options and Netssh defaults
298
- * Fixed race condition where output of failed command would be empty. @townsen
299
- Caused random failures of `test_execute_raises_on_non_zero_exit_status_and_captures_stdout_and_stderr`
300
- Also fixes output handling in failed commands, and generally buggy output.
301
- * Remove override of backtrace() and backtrace_locations() from ExecuteError. @townsen
302
- This interferes with rake default behaviour and creates duplicate stacktraces.
303
- * Allow running local commands using `on(:local)`
304
- * Implement the upload! and download! methods for the local backend
305
-
306
- ## 1.6.0
307
-
308
- * Fix colorize to use the correct API (@fazibear)
309
- * Lock colorize (sorry guys) version at >= 0.7.0
310
-
311
- ## 1.6.0 (Yanked, because of colorize.)
312
-
313
- * Force dependency on colorize v0.6.0
314
- * Add your entries here, remember to credit yourself however you want to be
315
- credited!
316
- * Remove strip from capture to preserve whitespace. Nick Townsend
317
- * Add vmware_fusion Vagrant provider. Nick Townsend
318
- * Add some padding to the pretty log formatter
319
-
320
- ## 1.5.1
321
-
322
- * Use `sudo -u` rather than `sudo su` to switch users. Mat Trudel
323
-
324
- ## 1.5.0
325
-
326
- * Deprecate background helper - too many badly behaved pseudo-daemons. Lee Hambley
327
- * Don't colourize unless $stdout is a tty. Lee Hambley
328
- * Remove out of date "Known Issues" section from README. Lee Hambley
329
- * Dealy variable interpolation inside `as()` block. Nick Townsend
330
- * Fixes for functional tests under modern Vagrant. Lewis Marshal
331
- * Fixes for connection pooling. Chris Heald
332
- * Add `localhost` hostname to local backend. Adam Mckaig
333
- * Wrap execptions to include hostname. Brecht Hoflack
334
- * Remove `shellwords` stdlib dependency Bruno Sutic
335
- * Remove unused `cooldown` accessor. Bruno Sutic
336
- * Replace Term::ANSIColor with a lighter solution. Tom Clements
337
- * Documentation fixes. Matt Brictson
338
-
339
- ## 1.4.0
340
-
341
- https://github.com/capistrano/sshkit/compare/v1.3.0...v1.4.0
342
-
343
- * Removed `invoke` alias for [`SSHKit::Backend::Printer.execute`](https://github.com/capistrano/sshkit/blob/master/lib/sshkit/backends/printer.rb#L20). This is to prevent collisions with
344
- methods in capistrano with similar names, and to provide a cleaner API. See [capistrano issue 912](https://github.com/capistrano/capistrano/issues/912) and [issue 107](https://github.com/capistrano/sshkit/issues/107) for more details.
345
- * Connection pooling now uses a thread local to store connection pool, giving each thread its own connection pool. Thank you @mbrictson see [#101](https://github.com/capistrano/sshkit/pull/101) for more.
346
- * Command map indifferent towards strings and symbols thanks to @thomasfedb see [#91](https://github.com/capistrano/sshkit/pull/91)
347
- * Moved vagrant wrapper to `support` directory, added ability to run tests with vagrant using ssh. @miry see [#64](https://github.com/capistrano/sshkit/pull/64)
348
- * Removed unnecessary require `require_relative '../sshkit'` in `lib/sshkit/dsl.rb` prevents warnings thanks @brabic.
349
- * Doc fixes thanks @seanhandley @vojto
350
-
351
- ## 1.3.0
352
-
353
- https://github.com/capistrano/sshkit/compare/v1.2.0...v1.3.0
354
-
355
- * Connection pooling. SSH connections are reused across multiple invocations
356
- of `on()`, which can result in significant performance gains. See:
357
- https://github.com/capistrano/sshkit/pull/70. Matt @mbrictson Brictson.
358
- * Fixes to the Formatter::Dot and to the formatter class name resolver. @hab287:w
359
- * Added the license to the Gemspec. @anatol.
360
- * Fix :limit handling for the `in: :groups` run mode. Phil @phs Smith
361
- * Doc fixes @seanhandley, @sergey-alekseev.
362
-
363
- ## 1.2.0
364
-
365
- https://github.com/capistrano/sshkit/compare/v1.1.0...v1.2.0
366
-
367
- * Support picking up a project local SSH config file, if a SSH config file
368
- exists at ./.ssh/config it will be merged with the ~/.ssh/config. This is
369
- ideal for defining project-local proxies/gateways, etc. Thanks to Alex
370
- @0rca Vzorov.
371
- * Tests and general improvements to the Printer backends (mostly used
372
- internally). Thanks to Michael @miry Nikitochkin.
373
- * Update the net-scp dependency version. Thanks again to Michael @miry
374
- Nikitochkin.
375
- * Improved command map. This feature allows mapped variables to be pushed
376
- and unshifted onto the mapping so that the Capistrano extensions for
377
- rbenv and bundler, etc can work together. For discussion about the reasoning
378
- see https://github.com/capistrano/capistrano/issues/639 and
379
- https://github.com/capistrano/sshkit/pull/45. A big thanks to Kir @kirs
380
- Shatrov.
381
- * `test()` and `capture()` now behave as expected inside a `run_locally` block
382
- meaning that they now run on your local machine, rather than erring out. Thanks
383
- to Kentaro @kentaroi Imai.
384
- * The `:wait` option is now successfully passed to the runner now. Previously the
385
- `:wait` option was ignored. Thanks to Jordan @jhollinger Hollinger for catching
386
- the mistake in our test coverage.
387
- * Fixes and general improvements to the `download()` method which until now was
388
- quite naïve. Thanks to @chqr.
389
-
390
- ## 1.1.0
391
-
392
- https://github.com/capistrano/sshkit/compare/v1.0.0...v1.1.0
393
-
394
- * Please see the Git history. `git rebase` ate our changelog (we should have been
395
- more careful)
396
-
397
- ## 1.0.0
398
-
399
- * The gem now supports a run_locally, although it's nothing to do with SSH,
400
- it makes a nice API. There are examples in the EXAMPLES.md.
401
-
402
- ## 0.0.34
403
-
404
- * Allow the setting of global SSH options on the `backend.ssh` as a hash,
405
- these options are the same as Net::SSH configure expects. Thanks to Rafał
406
- @lisukorin Lisowski
407
-
408
- ## 0.0.32
409
-
410
- * Lots of small changes since 0.0.27.
411
- * Particularly working around a possible NaN issue when uploading
412
- comparatively large files.
413
-
414
- ## 0.0.27
415
-
416
- * Don't clobber SSH options with empty values. This allows Net::SSH to
417
- do the right thing most of the time, and look into the SSH configuration
418
- files.
419
-
420
- ## 0.0.26
421
-
422
- * Pretty output no longer prints white text. ("Command.....")
423
- * Fixed a double-output bug, where upon receiving the exit status from a
424
- remote command, the last data packet that it sent would be re-printed
425
- by the pretty formatter.
426
- * Integration tests now use an Ubuntu Precise 64 Vagrant base box.
427
- * Additional host declaration syntax, `SSHKit::Host` can now take a hash of
428
- host properties in addition to a number of new (common sense) DSN type
429
- syntaxes.
430
- * Changes to the constants used for logging, we no longer re-define a
431
- `Logger::TRACE` constant on the global `Logger` class, rather everyhing
432
- now uses `SSHKit::Logger` (Thanks to Rafa Garcia)
433
- * Various syntax and documentation fixes.
434
-
435
- ## 0.0.25
436
-
437
- * `upload!` and `download!` now log to different levels depending on
438
- completion percentage. When the upload is 0 percent complete or a number
439
- indivisible by 10, the message is logged to `Logger::DEBUG` otherwise the
440
- message is logged to `Logger::INFO`, this should mean that normal users at
441
- a sane log level should see upload progress jump to `100%` for small
442
- files, and otherwise for larger files they'll see output every `10%`.
443
-
444
- ## 0.0.24
445
-
446
- * Pretty output now streams stdout and stderr. Previous versions would
447
- append (`+=`) chunks of data written by the remote host to the `Command`
448
- instance, and the `Pretty` formatter would only print stdout/stderr if the
449
- command was `#complete?`. Historically this lead to issues where the
450
- remote process was blocking for input, had written the prompt to stdout,
451
- but it was not visible on the client side.
452
-
453
- Now each time the command is passed to the output stream, the
454
- stdout/stderr are replaced with the lines returned from the remote server
455
- in this chunk. (i.e were yielded to the callback block). Commands now have
456
- attribute accessors for `#full_stdout` and `#full_stderr` which are appended
457
- in the way that `#stdout` and `#stderr` were previously.
458
-
459
- This should be considered a private API, and one should beware of relying
460
- on `#full_stdout` or `#full_stderr`, they will likely be replaced with a
461
- cleaner soltion eventually.
462
-
463
- * `upload!` and `download!` now print progress reports at the `Logger::INFO`
464
- verbosity level.
465
-
466
- ## 0.0.23
467
-
468
- * Explicitly rely on `net-scp` gem.
469
-
470
- ## 0.0.22
471
-
472
- * Added naïve implementations of `upload!()` and `download!()` (syncoronous) to
473
- the Net::SSH backend. See `EXAMPLES.md` for more extensive usage examples.
474
-
475
- The `upload!()` method can take a filename, or an `IO`, this reflects the way
476
- the underlying Net::SCP implementation works. The same is true of
477
- `download!()`, when called with a single argument it captures the file's
478
- contents, otherwise it downloads the file to the local disk.
479
-
480
- on hosts do |host|
481
- upload!(StringIO.new('some-data-here'), '~/.ssh/authorized_keys')
482
- upload!('~/.ssh/id_rsa.pub', '~/.ssh/authorized_keys')
483
- puts download!('/etc/monit/monitrc')
484
- download!('/etc/monit/monitrc', '~/monitrc')
485
- end
486
-
487
- ## 0.0.21
488
-
489
- * Fixed an issue with default formatter
490
- * Modified `SSHKit.config.output_verbosity=` to accept different objects:
491
-
492
- SSHKit.config.output_verbosity = Logger::INFO
493
- SSHKit.config.output_verbosity = :info
494
- SSHKit.config.output_verbosity = 1
495
-
496
- ## 0.0.20
497
-
498
- * Fixed a bug where the log level would be assigned, not compared in the
499
- pretty formatter, breaking the remainder of the output verbosity.
500
-
501
- ## 0.0.19
502
-
503
- * Modified the `Pretty` formatter to include the log level in front of
504
- executed commands.
505
-
506
- * Modified the `Pretty` formatter not to print stdout and stderr by default,
507
- the log level must be raised to Logger::DEBUG to see the command outputs.
508
-
509
- * Modified the `Pretty` formatter to use `Command#to_s` when printing the
510
- command, this prints the short form (without modifications/wrappers applied
511
- to the command for users, groups, directories, umasks, etc).
512
-
513
- ## 0.0.18
514
-
515
- * Enable `as()` to take either a string/symbol as previously, but also now
516
- accepts a hash of `{user: ..., group: ...}`. In case that your host system
517
- supports the command `sg` (`man 1 sg`) to switch your effective group ID
518
- then one can work on files as a team group user.
519
-
520
- on host do |host|
521
- as user: :peter, group: griffin do
522
- execute :touch, 'somefile'
523
- end
524
- end
525
-
526
- will result in a file with the following permissions:
527
-
528
- -rw-r--r-- 1 peter griffin 0 Jan 27 08:12 somefile
529
-
530
- This should make it much easier to share deploy scripts between team
531
- members.
532
-
533
- **Note:** `sg` has some very strict user and group password requirements
534
- (the user may not have a password (`passwd username -l` to lock an account
535
- that already has a password), and the group may not have a password.)
536
-
537
- Additionally, and unsurprisingly *the user must also be a member of the
538
- group.*
539
-
540
- `sg` was chosen over `newgrp` as it's easier to embed in a one-liner
541
- command, `newgrp` could be used with a heredoc, but my research suggested
542
- that it might be better to use sg, as it better represents my intention, a
543
- temporary switch to a different effective group.
544
-
545
- * Fixed a bug with environmental variables and umasking introduced in 0.0.14.
546
- Since that version the environmental variables were being presented to the
547
- umask command's subshell, and not to intended command's subshell.
548
-
549
- incorrect: `ENV=var umask 002 && env`
550
- correct: `umask 002 && ENV=var env`
551
-
552
- * Changed the exception handler, if a command returns with a non-zero exit
553
- status then the output will be prefixed with the command name and which
554
- channel any output was written to, for example:
555
-
556
- Command.new("echo ping; false")
557
- => echo stdout: ping
558
- echo stderr: Nothing written
559
-
560
- In this contrived example that's more or less useless, however with badly
561
- behaved commands that write errors to stdout, and don't include their name
562
- in the program output, it can help a lot with debugging.
563
-
564
- ## 0.0.17
565
-
566
- * Fixed a bug introduced in 0.0.16 where the capture() helper returned
567
- the name of the command that had been run, not it's output.
568
-
569
- * Classify the pre-directory switch, and pre-user switch command guards
570
- as having a DEBUG log level to exclude them from the logs.
571
-
572
- ## 0.0.16
573
-
574
- * Fixed a bug introduced in 0.0.15 where the capture() helper returned
575
- boolean, discarding any output from the server.
576
-
577
- ## 0.0.15
578
-
579
- * `Command` now takes a `verbosity` option. This defaults to `Logger::INFO`
580
- and can be set to any of the Ruby logger level constants. You can also set
581
- it to the symbol `:debug` (and friends) which will be expanded into the correct
582
- constants.
583
-
584
- The log verbosity level is set to Logger::INFO by default, and can be
585
- overridden by setting `SSHKit.config.output_verbosity = Logger::{...}`,
586
- pick a level that works for you.
587
-
588
- By default `test()` and `capture()` calls are surpressed, and not printed
589
- by the pretty logger as of this version.
590
-
591
- ## 0.0.14
592
-
593
- * Umasks can now be set on `Command` instances. It can be set globally with
594
- `SSHKit.config.umask` (default, nil; meaning take the system default). This
595
- can be used to set, for example a umask of `007` for allowing users with
596
- the same primary group to share code without stepping on eachother's toes.
597
-
598
- ## 0.0.13
599
-
600
- * Correctly quote `as(user)` commands, previously it would expand to:
601
- `sudo su user -c /usr/bin/env echo "Hello World"`, in which the command to
602
- run was taken as simply `/usr/bin/env`. By quoting all arguments it should
603
- now work as expected. `sudo su user -c "/usr/bin/env echo \""Hello World\""`
604
-
605
- ## 0.0.12
606
-
607
- * Also print anything the program wrote to stdout when the exit status is
608
- non-zero and the command raises an error. (assits debugging badly behaved
609
- programs that fail, and write their error output to stdout.)
610
-
611
- ## 0.0.11
612
-
613
- * Implementing confuguration objects on the backends (WIP, undocumented)
614
- * Implement `SSHKit.config.default_env`, a hash which can be modified and
615
- will act as a global `with`.
616
- * Fixed #9 (with(a: 'b', c: 'c') being parsed as `A=bC=d`. Now properly space
617
- separated.
618
- * Fixed #10 (overly aggressive shell escaping), one can now do:
619
- `with(path: 'foo:$PATH') without the $ being escaped too early.
620
-
621
- ## 0.0.10
622
-
623
- * Include more attributes in `Command#to_hash`.
624
-
625
- ## 0.0.9
626
-
627
- * Include more attributes in `Command#to_hash`.
628
-
629
- ## 0.0.8
630
-
631
- * Added DSL method `background()` this sends a task to the background using
632
- `nohup` and redirects it's output to `/dev/null` so as to avoid littering
633
- the filesystem with `nohup.out` files.
634
-
635
- **Note:** Backgrounding a task won't work as you expect if you give it a
636
- string, that is you must do `background(:sleep, 5)` and not `background("sleep 5")`
637
- according to the rules by which a command is not processed in any way **if it
638
- contains a spaca character in it's first argument**.
639
-
640
- Usage Example:
641
-
642
- on hosts do
643
- background :rake, "assets:precompile" # typically takes 5 minutes!
644
- end
645
-
646
- **Further:** Many programs are badly behaved and no not work well with `nohup`
647
- it has to do with the way nohup works, reopening the processe's file
648
- descriptors and redirecting them. Programs that re-open, or otherwise
649
- manipulate their own file descriptors may lock up when the SSH session is
650
- disconnected, often they block writing to, or reading from stdin/out.
651
-
652
- ## 0.0.7
653
-
654
- * DSL method `execute()` will now raise `SSHKit::Command::Failed` when the
655
- exit status is non-zero. The message of the exception will be whatever the
656
- process had written to stdout.
657
- * New DSL method `test()` behaves as `execute()` used to until this version.
658
- * `Command` now raises an error in `#exit_status=()` if the exit status given
659
- is not zero. (see below)
660
- * All errors raised by error conditions of SSHKit are defined as subclasses of
661
- `SSHKit::StandardError` which is itself a subclass of `StandardError`.
662
-
663
- The `Command` objects can be set to not raise, by passing `raise_on_non_zero_exit: false`
664
- when instantiating them, this is exactly what `test()` does internally.
665
-
666
- Example:
667
-
668
- on hosts do |host
669
- if test "[ -d /opt/sites ]" do
670
- within "/opt/sites" do
671
- execute :git, :pull
672
- end
673
- else
674
- execute :git, :clone, 'some-repository', '/opt/sites'
675
- end
676
- end
677
-
678
- ## 0.0.6
679
-
680
- * Support arbitrary properties on Host objects. (see below)
681
-
682
- Starting with this version, the `Host` class supports arbitrary properties,
683
- here's a proposed use-case:
684
-
685
- servers = %w{one.example.com two.example.com
686
- three.example.com four.example.com}.collect do |s|
687
- h = SSHKit::Host.new(s)
688
- if s.match /(one|two)/
689
- h.properties.roles = [:web]
690
- else
691
- h.properties.roles = [:app]
692
- end
693
- end
694
-
695
- on servers do |host|
696
- if host.properties.roles.include?(:web)
697
- # Do something pertinent to web servers
698
- elsif host.properties.roles.include?(:app)
699
- # Do something pertinent to application servers
700
- end
701
- end
702
-
703
- Naturally, this is a contrived example, the `#properties` attribute on the
704
- Host instance is implemented as an [`OpenStruct`](http://ruby-doc.org/stdlib-1.9.3/libdoc/ostruct/rdoc/OpenStruct.html) and
705
- will behave exactly as such.
706
-
707
- ## 0.0.5
708
-
709
- * Removed configuration option `SSHKit.config.format` (see below)
710
- * Removed configuration option `SSHKit.config.runner` (see below)
711
-
712
- The format should now be set by doing:
713
-
714
- SSHKit.config.output = File.open('/dev/null')
715
- SSHKit.config.output = MyFormatterClass.new($stdout)
716
-
717
- The library ships with three formatters, `BlackHole`, `Dot` and `Pretty`.
718
-
719
- The default is `Pretty`, but can easily be changed:
720
-
721
- SSHKit.config.output = SSHKit::Formatter::Pretty.new($stdout)
722
- SSHKit.config.output = SSHKit::Formatter::Dot.new($stdout)
723
- SSHKit.config.output = SSHKit::Formatter::BlackHole.new($stdout)
724
-
725
- The one and only argument to the formatter is the *String/StringIO*ish object
726
- to which the output should be sent. (It should be possible to stack
727
- formatters, or build a multi-formatter to log, and stream to the screen, for
728
- example)
729
-
730
- The *runner* is now set by `default_options` on the Coordinator class. The
731
- default is still *:parallel*, and can be overridden on the `on()` (or
732
- `Coordinator#each`) calls directly.
733
-
734
- There is no global way to change the runner style for all `on()` calls as of
735
- version `0.0.5`.
736
-
737
- ## 0.0.4
738
-
739
- * Rename the ConnectionManager class to Coordinator, connections are handled
740
- in the backend, if it needs to create some connections.
741
-
742
- ## 0.0.3
743
-
744
- * Refactor the runner classes into an abstract heirarchy.
745
-
746
- ## 0.0.2
747
-
748
- * Include a *Pretty* formatter
749
- * Modify example to use Pretty formatter.
750
- * Move common behaviour to an abstract formatter.
751
- * Formatters no longer inherit StringIO
752
-
753
- ## 0.0.1
754
-
755
- First release.
756
-
757
- [Unreleased]: https://github.com/capistrano/sshkit/compare/v1.18.1...HEAD
758
- [1.18.1]: https://github.com/capistrano/sshkit/compare/v1.18.0...v1.18.1
759
- [1.18.0]: https://github.com/capistrano/sshkit/compare/v1.17.0...v1.18.0
760
- [1.17.0]: https://github.com/capistrano/sshkit/compare/v1.16.1...v1.17.0
761
- [1.16.1]: https://github.com/capistrano/sshkit/compare/v1.16.0...v1.16.1
762
- [1.16.0]: https://github.com/capistrano/sshkit/compare/v1.15.1...v1.16.0
763
- [1.15.1]: https://github.com/capistrano/sshkit/compare/v1.15.0...v1.15.1
764
- [1.15.0]: https://github.com/capistrano/sshkit/compare/v1.14.0...v1.15.0
765
- [1.14.0]: https://github.com/capistrano/sshkit/compare/v1.13.1...v1.14.0
766
- [1.13.1]: https://github.com/capistrano/sshkit/compare/v1.13.0...v1.13.1
767
- [1.13.0]: https://github.com/capistrano/sshkit/compare/v1.12.0...v1.13.0
768
- [1.12.0]: https://github.com/capistrano/sshkit/compare/v1.11.5...v1.12.0
769
- [1.11.5]: https://github.com/capistrano/sshkit/compare/v1.11.4...v1.11.5
770
- [1.11.4]: https://github.com/capistrano/sshkit/compare/v1.11.3...v1.11.4
771
- [1.11.3]: https://github.com/capistrano/sshkit/compare/v1.11.2...v1.11.3
772
- [1.11.2]: https://github.com/capistrano/sshkit/compare/v1.11.1...v1.11.2
773
- [1.11.1]: https://github.com/capistrano/sshkit/compare/v1.11.0...v1.11.1
774
- [1.11.0]: https://github.com/capistrano/sshkit/compare/v1.10.0...v1.11.0
1
+ Release notes for this project are kept here: https://github.com/capistrano/sshkit/releases