Class: Awshark::Ecs::Subcommand

Inherits:
Thor
  • Object
show all
Includes:
ClassOptions
Defined in:
lib/awshark/ecs/subcommand.rb

Instance Method Summary collapse

Methods included from ClassOptions

#process_class_options

Instance Method Details

#listObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/awshark/ecs/subcommand.rb', line 20

def list
  process_class_options

  manager = Awshark::Ecs::Manager.new
  manager.clusters.each do |cluster|
    puts "\n"
    puts manager.inspect_cluster(cluster)
    cluster.services.each do |service|
      puts manager.inspect_service(service)
    end
  end
end

#loginObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/awshark/ecs/subcommand.rb', line 39

def 
  response = client.get_authorization_token
  token = Base64.decode64(response.authorization_data.first.authorization_token)

  user_name = token.split(':').first
  password = token.split(':').last
  url = "https://#{Awshark.config.sts.}.dkr.ecr.eu-central-1.amazonaws.com"

  `docker login -u #{user_name} -p #{password} #{url}`
end