Sha256: 98495a387e823fe69115641dd2ee2e8f71c5e2b539b01b9e2ff0a38d7edfd968

Contents?: true

Size: 965 Bytes

Versions: 20

Compression:

Stored size: 965 Bytes

Contents

require 'shipitron'
require 'shipitron/ecs_client'

module Shipitron
  module Server
    module EcsTaskDefs
      class UpdateFromParams
        include Metaractor
        include EcsClient

        required :region
        required :ecs_task_defs

        def call
          ecs_task_defs.each do |ecs_task_def|
            next if ecs_task_def.params.nil?

            ecs_task_def.revision = ecs_client(region: region).register_task_definition(
              ecs_task_def.params.to_h
            ).task_definition.revision

            Logger.info "Created task definition #{ecs_task_def}"
          end
        rescue Aws::ECS::Errors::ServiceError => e
          fail_with_errors!(messages: [
            "Error: #{e.message}",
            e.backtrace.join("\n")
          ])
        end

        private
        def region
          context.region
        end

        def ecs_task_defs
          context.ecs_task_defs
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shipitron-1.4.1 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.4.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.3.2 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.3.1 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.3.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.2.1 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.2.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.1.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.0.1 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-1.0.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.4.1 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.4.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.3.5 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.3.4 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.3.3 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.3.1 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.3.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.2.2 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.2.1 lib/shipitron/server/ecs_task_defs/update_from_params.rb
shipitron-0.2.0 lib/shipitron/server/ecs_task_defs/update_from_params.rb