class ECSHelper::ServiceHelper

Attributes

cluster[RW]
current_service[RW]
helper[RW]
services[RW]

Public Class Methods

new(helper) click to toggle source
# File lib/ecs_helper/service_helper.rb, line 6
def initialize(helper)
  @helper = helper
end

Public Instance Methods

from_env() click to toggle source
# File lib/ecs_helper/service_helper.rb, line 25
def from_env
  services.find {|s| s.include?(helper.application) && s.include?(helper.environment)}
end
from_options() click to toggle source
# File lib/ecs_helper/service_helper.rb, line 18
def from_options
  value = helper.options[:service]
  return nil unless value
  return value if services.include?(value)
  raise(StandardError.new("Service specified in cli not exists, services you have: #{services}")) unless services.find {|r| r == value}
end
only_one() click to toggle source
# File lib/ecs_helper/service_helper.rb, line 29
def only_one
  return services[0] if services.length == 1
end
update_service(cluster, service, task_definition) click to toggle source
# File lib/ecs_helper/service_helper.rb, line 33
def update_service(cluster, service, task_definition)
  helper.client.update_service({
    cluster: cluster,
    service: service,
    task_definition: task_definition
  })
end