contexto 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contexto/contextualize.rb +4 -4
- data/lib/contexto/ssh.rb +4 -2
- data/lib/contexto/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ed0dae3dc6d2cc4a7cc2a86aa43e8909b186296
|
4
|
+
data.tar.gz: cd7ea8c368ed15eec74cb753fccbbd4f9595d468
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e72fb0a5c18b599a78b234aa3fa4241236f9db916783e2cc5db0f71256b006798c9fe7bf197f585b28ec483cce8962abb1528232db4ed3c6c528e8de3b8e13b1
|
7
|
+
data.tar.gz: 562dce25640cc188a5c4ef3e23b81c41d3be6c72a8bbf9a3613823f68c8f42e7b4262f452f1180990cd5048c49460ee37258158247610d11a804fccda629b851
|
@@ -20,13 +20,13 @@ module Contexto
|
|
20
20
|
if connect?
|
21
21
|
task = describe_tasks
|
22
22
|
ec2_instance_id = describe_container_instance(task[:container_instance_arn])
|
23
|
-
@
|
23
|
+
@connection = Contexto::SSH.new(describe_instances(ec2_instance_id), cluster, service, container)
|
24
24
|
if console
|
25
|
-
@
|
25
|
+
@connection.console
|
26
26
|
elsif ssh
|
27
|
-
@
|
27
|
+
@connection.ssh
|
28
28
|
elsif rake
|
29
|
-
@
|
29
|
+
@connection.rake(rake)
|
30
30
|
end
|
31
31
|
return
|
32
32
|
end
|
data/lib/contexto/ssh.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
module Contexto
|
3
3
|
# SSH class
|
4
4
|
class SSH
|
5
|
+
attr_reader :ipaddress, :cluster, :service, :container
|
6
|
+
|
5
7
|
def initialize(ipaddress, cluster, service, container)
|
6
8
|
@ipaddress = ipaddress
|
7
9
|
@cluster = cluster
|
@@ -26,11 +28,11 @@ module Contexto
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def ssh_cmd
|
29
|
-
"ssh -t -A #{@bastion_host} \"ssh -t ec2-user@#{
|
31
|
+
"ssh -t -A #{@bastion_host} \"ssh -t ec2-user@#{ipaddress} "
|
30
32
|
end
|
31
33
|
|
32
34
|
def cmd
|
33
|
-
"'docker exec -it \\$(docker ps | grep ecs-#{
|
35
|
+
"'docker exec -it \\$(docker ps | grep ecs-#{cluster}-#{service}-.*-#{container} | cut -d\\ -f1) bin/rails "
|
34
36
|
end
|
35
37
|
end
|
36
38
|
end
|
data/lib/contexto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contexto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Turnbull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|