docker-pier 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: c6ceb7879c80d9c132767117c4e77d3061939e77
4
- data.tar.gz: 949f3445b7f3c40d84b0b57c3d2de241c2f2547c
3
+ metadata.gz: 36133eae6393dbb4ee065dad45ed867ede39e71f
4
+ data.tar.gz: f56d49587499654c122e5d7017feb50863751ac7
5
5
  SHA512:
6
- metadata.gz: 7dd886943e8278fdacb675761b58748c631b0d6a8a1cfad44cce61aefe6bb483cbc9cc449cfaf29822ec89e3e517632638a933c5965732b0071520aff75faaca
7
- data.tar.gz: 573c684f9bebdd8d77d3c8db09072681a5f0b7f771c5d66b80978bf6fa1ae34ac217ce9278a38ab2d93e0cb9efb8c61eb29e438524d2876457492764ee8bf31f
6
+ metadata.gz: 61119c6b0c5896341b3ec483d0f103d6a5d5b38c790f4aa9ed8cc6ea26ae79639c9fa2f3c03ff21c7b721313cb11e6f77c7098c8a1d93d5c018cb1749099d3a8
7
+ data.tar.gz: 2ce98586c69e08df2a8697ee7f25962c83b46fc60e1ee5ec96cb06d5e5f4124ef3b4c3b514707ef03d446f9e157546e356ed29a7e7626dbb834aac9045c3f94f
@@ -216,4 +216,19 @@ Main do
216
216
  end
217
217
  end
218
218
  end
219
+
220
+ mode 'shell' do
221
+ def run
222
+ cluster_name = ENV['DOCKER_MACHINE_NAME']
223
+ pier = db[:clusters].where(name: cluster_name).first
224
+ unless pier
225
+ $stderr.puts "unknown cluster '#{cluster_name}'"
226
+ return false
227
+ end
228
+ pier = DockerPier::Pier.new(pier[:pier_uri], name: pier[:name])
229
+
230
+ execv = ['ssh', '-A', pier.ssh_connstring] + ARGV[1..-1]
231
+ Kernel.exec(*execv)
232
+ end
233
+ end
219
234
  end
@@ -42,6 +42,12 @@ class DockerPier::Pier
42
42
  attr_reader :docker_uri
43
43
  attr_reader :ssh_uri
44
44
 
45
+ def ssh_connstring
46
+ host_part = @ssh_uri.hostname
47
+ host_part = ("%s@%s" % [@ssh_uri.user, host_part]) if @ssh_uri.user
48
+ host_part = ("-p %d %s" % [@ssh_uri.port, host_part]) if (@ssh_uri.port and @ssh_uri.port != 22)
49
+ host_part
50
+ end
45
51
 
46
52
  def x509_dir
47
53
  Pathname.new(ENV['HOME']) + '.docker-pier' + 'x509' + @name
@@ -1,3 +1,3 @@
1
1
  module DockerPier
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-pier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Levi Aul