bard 0.45.1 → 0.46.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bard/base.rb +8 -3
- data/lib/bard/config.rb +2 -2
- data/lib/bard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 052770d2821e0c8ed3ad4b90a031bfb1cde2dc7b1c8b346b9ac3c0433db667fd
|
4
|
+
data.tar.gz: 5c42dcb089ff3488eb990f582986354acd974c0f68199f6a7a9cca01e91cb2ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09cc31d6f12248a5995cc93e435d540f4379c08b77e166196db38e96d11e40f73170989c1e86aa6309d57f3504072edda6827bee2eb05c49887ab2448d3d2248'
|
7
|
+
data.tar.gz: b34c19977c459886d012248301bc0b35afa668d08f5c0eb8ed05a76378c21174edd6192c53406b8f8ebf06bf97723ce3765bba488caae7db2b89ec9a5866af6e
|
data/lib/bard/base.rb
CHANGED
@@ -29,8 +29,10 @@ class Bard::CLI < Thor
|
|
29
29
|
def ssh_command server, command, home: false
|
30
30
|
server = @config.servers[server.to_sym]
|
31
31
|
uri = URI.parse("ssh://#{server.ssh}")
|
32
|
+
ssh_key = server.ssh_key ? "-i #{server.ssh_key} " : ""
|
33
|
+
command = "#{server.env} #{command}" if server.env
|
32
34
|
command = "cd #{server.path} && #{command}" unless home
|
33
|
-
command = "ssh -tt #{"-p#{uri.port} " if uri.port}#{uri.user}@#{uri.host} '#{command}'"
|
35
|
+
command = "ssh -tt #{ssh_key}#{"-p#{uri.port} " if uri.port}#{uri.user}@#{uri.host} '#{command}'"
|
34
36
|
if server.gateway
|
35
37
|
uri = URI.parse("ssh://#{server.gateway}")
|
36
38
|
command = "ssh -tt #{" -p#{uri.port} " if uri.port}#{uri.user}@#{uri.host} \"#{command}\""
|
@@ -45,12 +47,14 @@ class Bard::CLI < Thor
|
|
45
47
|
port = uri.port ? "-p#{uri.port}" : ""
|
46
48
|
gateway = server.gateway ? "-oProxyCommand='ssh #{port} #{uri.user}@#{uri.host} -W %h:%p'" : ""
|
47
49
|
|
50
|
+
ssh_key = server.ssh_key ? "-i #{server.ssh_key}" : ""
|
51
|
+
|
48
52
|
uri = URI.parse("ssh://#{server.ssh}")
|
49
53
|
port = uri.port ? "-P#{uri.port}" : ""
|
50
54
|
from_and_to = [path, "#{uri.user}@#{uri.host}:#{server.path}/#{path}"]
|
51
55
|
|
52
56
|
from_and_to.reverse! if direction == :from
|
53
|
-
command = "scp #{gateway} #{port} #{from_and_to.join(" ")}"
|
57
|
+
command = "scp #{gateway} #{ssh_key} #{port} #{from_and_to.join(" ")}"
|
54
58
|
|
55
59
|
run_crucial command
|
56
60
|
end
|
@@ -62,9 +66,10 @@ class Bard::CLI < Thor
|
|
62
66
|
port = uri.port ? "-p#{uri.port}" : ""
|
63
67
|
gateway = server.gateway ? "-oProxyCommand=\"ssh #{port} #{uri.user}@#{uri.host} -W %h:%p\"" : ""
|
64
68
|
|
69
|
+
ssh_key = server.ssh_key ? "-i #{server.ssh_key}" : ""
|
65
70
|
uri = URI.parse("ssh://#{server.ssh}")
|
66
71
|
port = uri.port ? "-p#{uri.port}" : ""
|
67
|
-
ssh = "-e'ssh #{port} #{gateway}'"
|
72
|
+
ssh = "-e'ssh #{ssh_key} #{port} #{gateway}'"
|
68
73
|
|
69
74
|
dest_path = path.dup
|
70
75
|
dest_path = "./#{dest_path}"
|
data/lib/bard/config.rb
CHANGED
@@ -57,7 +57,7 @@ class Bard::CLI < Thor
|
|
57
57
|
instance_eval File.read(File.expand_path(path)) if File.exist?(path)
|
58
58
|
end
|
59
59
|
|
60
|
-
class Server < Struct.new(:project_name, :key, :ssh, :path, :ping, :gateway)
|
60
|
+
class Server < Struct.new(:project_name, :key, :ssh, :path, :ping, :gateway, :ssh_key, :env)
|
61
61
|
def self.setting *fields
|
62
62
|
fields.each do |field|
|
63
63
|
define_method field do |*args|
|
@@ -72,7 +72,7 @@ class Bard::CLI < Thor
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
setting :ssh, :path, :ping, :gateway
|
75
|
+
setting :ssh, :path, :ping, :gateway, :ssh_key, :env
|
76
76
|
|
77
77
|
def default_ping
|
78
78
|
uri = URI.parse("ssh://#{ssh}")
|
data/lib/bard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.46.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|