Sha256: dd38a8bb4f2c873c98ccacabdbb1a99fc8e41ea48099cff56aa05228964daeeb

Contents?: true

Size: 789 Bytes

Versions: 3

Compression:

Stored size: 789 Bytes

Contents

module Ufo
  class Scale < Base
    delegate :service, to: :info

    def initialize(service, count, options={})
      super(service, options)
      @count = count
    end

    def update
      unless service_exists?
        puts "Unable to find the #{@pretty_service_name.color(:green)} service on the #{@cluster.color(:green)} cluster."
        puts "Are you sure you are trying to scale the right service on the right cluster?"
        exit
      end
      ecs.update_service(
        service: service.service_name,
        cluster: @cluster,
        desired_count: @count
      )
      puts "Scale #{@pretty_service_name.color(:green)} service in #{@cluster.color(:green)} cluster to #{@count}" unless @options[:mute]
    end

    def service_exists?
      !!service
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ufo-4.3.1 lib/ufo/scale.rb
ufo-4.3.0 lib/ufo/scale.rb
ufo-4.2.0 lib/ufo/scale.rb