Sha256: 14ebc8c6beb498cc56bba218355b0c070d676804d3c6faac31d42b8d5914c9e6

Contents?: true

Size: 927 Bytes

Versions: 6

Compression:

Stored size: 927 Bytes

Contents

# frozen_string_literal: true

require 'aws-sdk-ecs'
require 'json'
require 'open3'

require 'container_ship/command/modules/docker'
require 'container_ship/command/modules/ecs'
require 'container_ship/command/modules/print_task'

module ContainerShip
  module Command
    class ShipCommand
      include Modules::Docker
      include Modules::Ecs
      include Modules::PrintTask

      def run(cluster_name, service_name, environment, build_number)
        task_definition = TaskDefinition.new(
          cluster_name,
          'services',
          service_name,
          environment,
          build_number
        )

        push_image task_definition

        revision = print_around_task('Registering task definition... ') do
          register task_definition
        end

        print_around_task('Updating service... ') do
          update_service task_definition, revision
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
container_ship-0.1.6 lib/container_ship/command/ship_command.rb
container_ship-0.1.5 lib/container_ship/command/ship_command.rb
container_ship-0.1.4 lib/container_ship/command/ship_command.rb
container_ship-0.1.3 lib/container_ship/command/ship_command.rb
container_ship-0.1.2 lib/container_ship/command/ship_command.rb
container_ship-0.1.1 lib/container_ship/command/ship_command.rb