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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee3f0c704b3e64a3bf0a7918efd31722f4c75ed1
4
- data.tar.gz: ad05060c02428b7ca51dc251faaa8e262dbca6c2
3
+ metadata.gz: 4ed0dae3dc6d2cc4a7cc2a86aa43e8909b186296
4
+ data.tar.gz: cd7ea8c368ed15eec74cb753fccbbd4f9595d468
5
5
  SHA512:
6
- metadata.gz: 654c9fac82ff73b4c37fe2afc391544350aacd5725a201d46b1f0b5f93c911e07e7ecc29db99cbc43a9e74f1583afa9f69f9b7675ee66dfdc07e607fe3b4679d
7
- data.tar.gz: 1e8676c564d870af09e1e7cfa2db6ea4dc9710c4b501ed6d213121a42832542409951d0362aa49f6e7a20160dc41e22ea4df19db89e310155618dcc03029174a
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
- @ssh = Contexto::SSH.new(describe_instances(ec2_instance_id), cluster, service, container)
23
+ @connection = Contexto::SSH.new(describe_instances(ec2_instance_id), cluster, service, container)
24
24
  if console
25
- @ssh.console
25
+ @connection.console
26
26
  elsif ssh
27
- @ssh.ssh
27
+ @connection.ssh
28
28
  elsif rake
29
- @ssh.rake(rake)
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@#{@ipaddress} "
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-#{@cluster}-#{@service}-.*-#{@container} | cut -d\\ -f1) bin/rails "
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
@@ -1,4 +1,4 @@
1
1
  # Contexto version
2
2
  module Contexto
3
- VERSION = '0.2.2'.freeze
3
+ VERSION = '0.2.3'.freeze
4
4
  end
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.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-01 00:00:00.000000000 Z
11
+ date: 2017-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk