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 +4 -4
- data/exe/docker-pier +15 -0
- data/lib/docker-pier/pier.rb +6 -0
- data/lib/docker-pier/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36133eae6393dbb4ee065dad45ed867ede39e71f
|
4
|
+
data.tar.gz: f56d49587499654c122e5d7017feb50863751ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61119c6b0c5896341b3ec483d0f103d6a5d5b38c790f4aa9ed8cc6ea26ae79639c9fa2f3c03ff21c7b721313cb11e6f77c7098c8a1d93d5c018cb1749099d3a8
|
7
|
+
data.tar.gz: 2ce98586c69e08df2a8697ee7f25962c83b46fc60e1ee5ec96cb06d5e5f4124ef3b4c3b514707ef03d446f9e157546e356ed29a7e7626dbb834aac9045c3f94f
|
data/exe/docker-pier
CHANGED
@@ -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
|
data/lib/docker-pier/pier.rb
CHANGED
@@ -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
|
data/lib/docker-pier/version.rb
CHANGED