Sha256: fc815b1eb7b342474b0149f87a66a6279c8d126cbb84ab60847a64bf92313648

Contents?: true

Size: 1.27 KB

Versions: 6

Compression:

Stored size: 1.27 KB

Contents

require 'trollop'

module SimpleDeploy
  module CLI

    class Events
      include Shared

      def show
        @opts = Trollop::options do
          version SimpleDeploy::VERSION
          banner <<-EOS

Show events for stack.

simple_deploy attributes -n STACK_NAME -e ENVIRONMENT

EOS
          opt :help, "Display Help"
          opt :count, "Count of events returned.", :type    => :integer,
                                                   :default => 3
          opt :environment, "Set the target environment", :type => :string
          opt :name, "Stack name to manage", :type => :string
          opt :read_from_env, "Read credentials and region from environment variables"
        end

        valid_options? :provided => @opts,
                       :required => [:environment, :name, :read_from_env]

        config_arg = @opts[:read_from_env] ? :read_from_env : @opts[:environment]
        SimpleDeploy.create_config config_arg
        SimpleDeploy.logger @opts[:log_level]
        stack = Stack.new :name        => @opts[:name],
                          :environment => @opts[:environment]

        rescue_exceptions_and_exit do
          jj stack.events @opts[:count]
        end
      end

      def command_summary
        "Show events for a stack"
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
simple_deploy-0.10.2 lib/simple_deploy/cli/events.rb
simple_deploy-0.10.1 lib/simple_deploy/cli/events.rb
simple_deploy-0.10.0 lib/simple_deploy/cli/events.rb
simple_deploy-0.10.0.beta.3 lib/simple_deploy/cli/events.rb
simple_deploy-0.10.0.beta.2 lib/simple_deploy/cli/events.rb
simple_deploy-0.10.0.beta.1 lib/simple_deploy/cli/events.rb