# Context module Contexto # SSH class class SSH def initialize(ipaddress, cluster, service, container) @ipaddress = ipaddress @cluster = cluster @service = service @container = container @bastion_host = 'bastion.empatico.xyz' @bastion_user = '' @user_name = 'ec2-user' @options = {} connect end def connect cmd = "ssh -t -A #{@bastion_host} \"ssh -t ec2-user@#{@ipaddress} 'docker exec -it \\$(docker ps | grep ecs-#{@cluster}-#{@service}-.*-#{@container} | cut -d\\ -f1) bin/rails c'\"" puts cmd end end end