Sha256: 130d8554e26b2a43ce3bf62933b63c376ae3d493f3271d45208933fd8fc77e85

Contents?: true

Size: 761 Bytes

Versions: 21

Compression:

Stored size: 761 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 #{@service.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 #{full_service.color(:green)} service in #{@cluster.color(:green)} to #{@count}" unless @options[:mute]
    end

    def service_exists?
      !!service
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ufo-5.0.7 lib/ufo/scale.rb
ufo-5.0.6 lib/ufo/scale.rb
ufo-5.0.5 lib/ufo/scale.rb
ufo-5.0.4 lib/ufo/scale.rb
ufo-5.0.3 lib/ufo/scale.rb
ufo-5.0.2 lib/ufo/scale.rb
ufo-5.0.1 lib/ufo/scale.rb
ufo-5.0.0 lib/ufo/scale.rb
ufo-4.6.3 lib/ufo/scale.rb
ufo-4.6.2 lib/ufo/scale.rb
ufo-4.6.1 lib/ufo/scale.rb
ufo-4.6.0 lib/ufo/scale.rb
ufo-4.5.11 lib/ufo/scale.rb
ufo-4.5.10 lib/ufo/scale.rb
ufo-4.5.9 lib/ufo/scale.rb
ufo-4.5.8 lib/ufo/scale.rb
ufo-4.5.7 lib/ufo/scale.rb
ufo-4.5.6 lib/ufo/scale.rb
ufo-4.5.5 lib/ufo/scale.rb
ufo-4.5.4 lib/ufo/scale.rb