trent 0.4.0 → 0.5.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 +5 -0
- data/README.md +4 -2
- data/lib/command/ssh/ssh.rb +3 -3
- data/lib/trent.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdf25e770aeae2915d5b48e3985fe1870b42e431202ce6633be269ee8c71d8f1
|
4
|
+
data.tar.gz: 07bce951325ff1f42536ece4ec95971232a9475bea43d7ba3c8a36be48a0d115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 303ffba9c1a02c66041063bb50c23b9d96d2127127f4674fe2505f4ed649213cf7464eb2338169639bf4a4e055c79df9d755a8bf51bcc032a6b5c6644c41725f
|
7
|
+
data.tar.gz: e2ab9621d83ae07fbf01dcb2fa07c25a023e457f418a820dea6424ba1d05acabbe3a3a31380093aa2065e43326b8bdfc5c25a33d04bc0a9093522d47690ff654
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -92,19 +92,21 @@ ci.sh("false", :fail_non_success => false)
|
|
92
92
|
ci.path("docker-compose", "/opt/bin/docker-compose")
|
93
93
|
```
|
94
94
|
|
95
|
-
# Run remote SSH shell
|
95
|
+
# Run remote SSH shell commands
|
96
96
|
|
97
97
|
```ruby
|
98
98
|
require 'trent'
|
99
99
|
|
100
100
|
ci = Trent.new()
|
101
|
-
ci.config_ssh('username', '111.111.234.332')
|
101
|
+
ci.config_ssh('username', '111.111.234.332', { :port => 22 })
|
102
102
|
|
103
103
|
result = ci.ssh("echo 'foo'")
|
104
104
|
|
105
105
|
puts result
|
106
106
|
```
|
107
107
|
|
108
|
+
*Note: The 3rd parameter to `config_ssh` is a hash passed to [the options parameter of net/ssh](http://net-ssh.github.io/net-ssh/Net/SSH.html#method-c-start) to allow full customization.*
|
109
|
+
|
108
110
|
When you run the script, you will see:
|
109
111
|
|
110
112
|
```
|
data/lib/command/ssh/ssh.rb
CHANGED
@@ -4,15 +4,15 @@ require 'net/ssh'
|
|
4
4
|
|
5
5
|
# Run SSH commands remotely on a server.
|
6
6
|
class SSH
|
7
|
-
def initialize(username, host,
|
7
|
+
def initialize(username, host, options)
|
8
8
|
@username = username
|
9
9
|
@host = host
|
10
|
-
@
|
10
|
+
@options = options
|
11
11
|
end
|
12
12
|
|
13
13
|
# Run the SSH command on the server
|
14
14
|
def run(command)
|
15
|
-
Net::SSH.start(@host, @username,
|
15
|
+
Net::SSH.start(@host, @username, @options) do |ssh|
|
16
16
|
output = ''
|
17
17
|
exit_code = nil
|
18
18
|
ssh.open_channel do |channel|
|
data/lib/trent.rb
CHANGED
@@ -24,8 +24,8 @@ class Trent
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# Configure how to run remote SSH commmands on server.
|
27
|
-
def config_ssh(username, host,
|
28
|
-
@ssh = SSH.new(username, host,
|
27
|
+
def config_ssh(username, host, options = nil)
|
28
|
+
@ssh = SSH.new(username, host, options)
|
29
29
|
end
|
30
30
|
|
31
31
|
# Configure how to communicate with GitHub
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Levi Bostian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -96,20 +96,20 @@ dependencies:
|
|
96
96
|
requirements:
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
99
|
+
version: '13.0'
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
102
|
+
version: 13.0.1
|
103
103
|
type: :development
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '13.0'
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
112
|
+
version: 13.0.1
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rspec
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|