Hello community, here is the log from the commit of package rubygem-sshkit for openSUSE:Factory checked in at 2020-03-07 21:40:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-sshkit (Old) and /work/SRC/openSUSE:Factory/.rubygem-sshkit.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-sshkit" Sat Mar 7 21:40:14 2020 rev:27 rq:773855 version:1.20.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-sshkit/rubygem-sshkit.changes 2019-08-06 15:10:46.603763466 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-sshkit.new.26092/rubygem-sshkit.changes 2020-03-07 21:40:20.856357593 +0100 @@ -1,0 +2,10 @@ +Mon Feb 10 15:52:44 UTC 2020 - Stephan Kulow <co...@suse.com> + +- updated to version 1.20.0 + see installed CHANGELOG.md + + ## [1.20.0][] (2019-08-03) + + * [#468](https://github.com/capistrano/sshkit/pull/468): Make `upload!` take a `:verbosity` option like `exec` does - [@grosser](https://github.com/grosser) + +------------------------------------------------------------------- Old: ---- sshkit-1.19.1.gem New: ---- sshkit-1.20.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-sshkit.spec ++++++ --- /var/tmp/diff_new_pack.mAxTAe/_old 2020-03-07 21:40:21.740358191 +0100 +++ /var/tmp/diff_new_pack.mAxTAe/_new 2020-03-07 21:40:21.740358191 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-sshkit # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-sshkit -Version: 1.19.1 +Version: 1.20.0 Release: 0 %define mod_name sshkit %define mod_full_name %{mod_name}-%{version} @@ -32,7 +32,7 @@ BuildRequires: %{rubygem gem2rpm} BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 -Url: http://github.com/capistrano/sshkit +URL: http://github.com/capistrano/sshkit Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: SSHKit makes it easy to write structured, testable SSH commands in ++++++ sshkit-1.19.1.gem -> sshkit-1.20.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2019-07-02 18:48:06.000000000 +0200 +++ new/CHANGELOG.md 2019-08-04 01:08:28.000000000 +0200 @@ -7,6 +7,10 @@ * Your contribution here! +## [1.20.0][] (2019-08-03) + + * [#468](https://github.com/capistrano/sshkit/pull/468): Make `upload!` take a `:verbosity` option like `exec` does - [@grosser](https://github.com/grosser) + ## [1.19.1][] (2019-07-02) * [#465](https://github.com/capistrano/sshkit/pull/456): Fix a regression in 1.19.0 that prevented `~` from being used in Capistrano paths, e.g. `:deploy_to`, etc. - [@grosser](https://github.com/grosser) @@ -768,7 +772,8 @@ First release. -[Unreleased]: https://github.com/capistrano/sshkit/compare/v1.19.1...HEAD +[Unreleased]: https://github.com/capistrano/sshkit/compare/v1.20.0...HEAD +[1.20.0]: https://github.com/capistrano/sshkit/compare/v1.19.1...v1.20.0 [1.19.1]: https://github.com/capistrano/sshkit/compare/v1.19.0...v1.19.1 [1.19.0]: https://github.com/capistrano/sshkit/compare/v1.18.2...v1.19.0 [1.18.2]: https://github.com/capistrano/sshkit/compare/v1.18.1...v1.18.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2019-07-02 18:48:06.000000000 +0200 +++ new/README.md 2019-08-04 01:08:28.000000000 +0200 @@ -6,29 +6,31 @@ [![Gem Version](https://badge.fury.io/rb/sshkit.svg)](https://rubygems.org/gems/sshkit) [![Build Status](https://travis-ci.org/capistrano/sshkit.svg?branch=master)](https://travis-ci.org/capistrano/sshkit) -## How might it work? +## Example -The typical use-case looks something like this: + - Connect to 2 servers + - Execute commands as `deploy` user with `RAILS_ENV=production` + - Execute commands in serial (default is `:parallel`) ```ruby require 'sshkit' require 'sshkit/dsl' include SSHKit::DSL -on %w{1.example.com 2.example.com}, in: :sequence, wait: 5 do |host| +on ["1.example.com", "2.example.com"], in: :sequence do |host| + puts "Now executing on #{host}" within "/opt/sites/example.com" do as :deploy do - with rails_env: :production do - rake "assets:precompile" - runner "S3::Sync.notify" - execute :node, "socket_server.js" + with RAILS_ENV: 'production' do + execute :rake, "assets:precompile" + execute :rails, "runner", "S3::Sync.notify" end end end end ``` -You can find many other examples of how to use SSHKit over in [EXAMPLES.md](EXAMPLES.md). +Many other examples are in [EXAMPLES.md](EXAMPLES.md). ## Basic usage @@ -37,7 +39,7 @@ pass `:local` to run commands locally. By default SSKit will run the commands on all hosts in parallel. -#### Running commands +### Running commands All backends support the `execute(*args)`, `test(*args)` & `capture(*args)` methods for executing a command. You can call any of these methods in the context of an `on()` @@ -63,7 +65,7 @@ By default the `capture` methods strips whitespace. If you need to preserve whitespace you can pass the `strip: false` option: `capture(:ls, '-l', strip: false)` -#### Transferring files +### Transferring files All backends also support the `upload!` and `download!` methods for transferring files. For the remote backend, the file is transferred with scp. @@ -75,7 +77,7 @@ end ``` -#### Users, working directories, environment variables and umask +### Users, working directories, environment variables and umask When running commands, you can tell SSHKit to set up the context for those commands using the following methods: @@ -113,6 +115,11 @@ Helpers such as `runner()` and `rake()` which expand to `execute(:rails, "runner", ...)` and `execute(:rake, ...)` are convenience helpers for Ruby, and Rails based apps. +### Verbosity / Silence + + - raise verbosity of a command: `execute "echo DEAD", verbosity: :ERROR` + - hide a command from output: `execute "echo HIDDEN", verbosity: :DEBUG` + ## Parallel Notice on the `on()` call the `in: :sequence` option, the following will do @@ -567,6 +574,20 @@ These system level files are the preferred way of setting up tunneling and proxies because the system implementations of these things are faster and better than the Ruby implementations you would get if you were to configure them through Net::SSH. In cases where it's not possible (Windows?), it should be possible to make use of the Net::SSH APIs to setup tunnels and proxy commands before deferring control to Capistrano/SSHKit.. +## Proxying + +To connect to the target host via a jump/bastion host, use a `Net::SSH::Proxy::Jump` + +```ruby +host = SSHKit::Host.new( + hostname: 'target.host.com', + ssh_options: { proxy: Net::SSH::Proxy::Jump.new("proxy.bar.com") } +) +on [host] do + execute :echo, '1' +end +``` + ## SSHKit Related Blog Posts [SSHKit Gem Basics](http://www.rubyplus.com/articles/591) Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/simple_connection.rb new/examples/simple_connection.rb --- old/examples/simple_connection.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/examples/simple_connection.rb 2019-08-04 01:08:28.000000000 +0200 @@ -0,0 +1,10 @@ +# tiny example so you can play with the sshkit or make a failing example for an issue +require 'bundler/setup' +require 'sshkit' +require 'sshkit/dsl' +include SSHKit::DSL + +on [ENV.fetch("HOST")] do + execute "echo hello" +end + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sshkit/backends/netssh.rb new/lib/sshkit/backends/netssh.rb --- old/lib/sshkit/backends/netssh.rb 2019-07-02 18:48:06.000000000 +0200 +++ new/lib/sshkit/backends/netssh.rb 2019-08-04 01:08:28.000000000 +0200 @@ -109,7 +109,8 @@ message = "#{action} #{name} #{percentage.round(2)}%" percentage_r = (percentage / log_percent).truncate * log_percent if percentage_r > 0 && (last_name != name || last_percentage != percentage_r) - info message + verbosity = (options[:verbosity] || :INFO).downcase # TODO: ideally reuse command.rb logic + public_send verbosity, message last_name = name last_percentage = percentage_r else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sshkit/version.rb new/lib/sshkit/version.rb --- old/lib/sshkit/version.rb 2019-07-02 18:48:06.000000000 +0200 +++ new/lib/sshkit/version.rb 2019-08-04 01:08:28.000000000 +0200 @@ -1,3 +1,3 @@ module SSHKit - VERSION = "1.19.1".freeze + VERSION = "1.20.0".freeze end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2019-07-02 18:48:06.000000000 +0200 +++ new/metadata 2019-08-04 01:08:28.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: sshkit version: !ruby/object:Gem::Version - version: 1.19.1 + version: 1.20.0 platform: ruby authors: - Lee Hambley @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2019-07-02 00:00:00.000000000 Z +date: 2019-08-03 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: net-ssh @@ -199,6 +199,7 @@ - Vagrantfile - examples/images/example_output.png - examples/images/logo.png +- examples/simple_connection.rb - lib/core_ext/array.rb - lib/core_ext/hash.rb - lib/sshkit.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/backends/test_netssh.rb new/test/unit/backends/test_netssh.rb --- old/test/unit/backends/test_netssh.rb 2019-07-02 18:48:06.000000000 +0200 +++ new/test/unit/backends/test_netssh.rb 2019-08-04 01:08:28.000000000 +0200 @@ -54,6 +54,13 @@ end end + def test_transfer_summarizer_uses_verbosity + netssh = Netssh.new(Host.new('fake')) + summarizer = netssh.send(:transfer_summarizer, 'Transferring', verbosity: :ERROR) + netssh.expects(:error).with { |msg| msg.include?('Transferring afile 15.0%') } + summarizer.call(nil,'afile',15,100) + end + if Net::SSH::Version::CURRENT >= Net::SSH::Version[3, 1, 0] def test_known_hosts_for_when_all_hosts_are_recognized perform_known_hosts_test('github', 'github.com')