Sha256: bc29142b2b2624c134a2985a257f67e55c1613aff4e3de688ed2852174130b6e

Contents?: true

Size: 1.02 KB

Versions: 52

Compression:

Stored size: 1.02 KB

Contents

module Opsicle
  module DeployHelper
    def launch_stack_monitor(response, options={})
      # Monitoring preferences
      if options[:browser]
        open_deploy(response[:deployment_id])
      elsif options[:monitor] # Default option
        Output.say_verbose "Starting Stack Monitor..."
        @monitor = Opsicle::Monitor::App.new(@environment, parse_options(response, options))
        @monitor.start
      end
    end

    def open_deploy(deployment_id)
      if deployment_id
        command = "open 'https://console.aws.amazon.com/opsworks/home?#/stack/#{client.config.opsworks_config[:stack_id]}/deployments'"
        Output.say_verbose "Executing shell command: #{command}"
        %x(#{command})
      else
        Output.say "Deploy failed. No deployment_id was received from OpsWorks", :error
      end
    end

    private

    def parse_options(response, options)
      if options[:track]
        options.delete(:track)
        options[:deployment_id] = response[:deployment_id]
      end

      options
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
opsicle-2.15.0 lib/opsicle/deploy_helper.rb
opsicle-2.14.2 lib/opsicle/deploy_helper.rb
opsicle-2.14.1 lib/opsicle/deploy_helper.rb
opsicle-2.14.0 lib/opsicle/deploy_helper.rb
opsicle-2.13.1 lib/opsicle/deploy_helper.rb
opsicle-2.13.0 lib/opsicle/deploy_helper.rb
opsicle-2.12.5 lib/opsicle/deploy_helper.rb
opsicle-2.12.3 lib/opsicle/deploy_helper.rb
opsicle-2.12.2 lib/opsicle/deploy_helper.rb
opsicle-2.12.1 lib/opsicle/deploy_helper.rb
opsicle-2.12.0 lib/opsicle/deploy_helper.rb
opsicle-2.11.3 lib/opsicle/deploy_helper.rb
opsicle-2.11.1 lib/opsicle/deploy_helper.rb
opsicle-2.11.0 lib/opsicle/deploy_helper.rb
opsicle-2.10.1 lib/opsicle/deploy_helper.rb
opsicle-2.10.0 lib/opsicle/deploy_helper.rb
opsicle-2.9.6 lib/opsicle/deploy_helper.rb
opsicle-2.9.4 lib/opsicle/deploy_helper.rb
opsicle-2.9.3 lib/opsicle/deploy_helper.rb
opsicle-2.9.2 lib/opsicle/deploy_helper.rb