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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae2aaf36ed328b519c7b21dde4613e2c5f9549477d032cb5208512a8a50c23fd
4
- data.tar.gz: a8d341af27fd88167618074ed12621a3cec1c14ed80abab8bb359f2678043de2
3
+ metadata.gz: 052770d2821e0c8ed3ad4b90a031bfb1cde2dc7b1c8b346b9ac3c0433db667fd
4
+ data.tar.gz: 5c42dcb089ff3488eb990f582986354acd974c0f68199f6a7a9cca01e91cb2ad
5
5
  SHA512:
6
- metadata.gz: 2f5de7283881fd2d654fe4a9c4975c9d03c110520982a9cfbb828bf1c31eb66da9aab1fa86e44218899b0ec85483105aa7efe9ec61319facf9e05c0001c8fad4
7
- data.tar.gz: 4f52fd46c07b105ae5ee32c379296785a0c06c2ba78c69a0731b8379c3577afdd7eaaddad09cb0d91d4dc2b247c0a082e1e383f9b1253beb4c94073f6b47e13e
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
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.45.1"
2
+ VERSION = "0.46.0"
3
3
  end
4
4
 
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.45.1
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-21 00:00:00.000000000 Z
11
+ date: 2021-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor