Sha256: 5de72e49dbb35392d0cd26057c310402e3b2bf59c425434ee23bfa761e24d0b8

Contents?: true

Size: 1.18 KB

Versions: 9

Compression:

Stored size: 1.18 KB

Contents

require 'trollop'

module SimpleDeploy
  module CLI
    class Attributes
      def show
        opts = Trollop::options do
          version SimpleDeploy::VERSION
          banner <<-EOS

Show attributes for stack.

simple_deploy attributes -n STACK_NAME -e ENVIRONMENT

EOS
          opt :help, "Display Help"
          opt :environment, "Set the target environment", :type => :string
          opt :log_level, "Log level:  debug, info, warn, error", :type    => :string,
                                                                  :default => 'info'
          opt :name, "Stack name to manage", :type => :string
        end

        CLI::Shared.valid_options? :provided => opts,
                                   :required => [:environment, :name]

        config = Config.new.environment opts[:environment]

        logger = SimpleDeployLogger.new :log_level => opts[:log_level]

        stack = Stack.new :environment => opts[:environment],
                          :name        => opts[:name],
                          :config      => config,
                          :logger      => logger
        Hash[stack.attributes.sort].each_pair { |k, v| puts "#{k}=#{v}" }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
simple_deploy-0.4.7 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.6 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.5 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.5.rc.0 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.4 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.3 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.2 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.1 lib/simple_deploy/cli/attributes.rb
simple_deploy-0.4.0 lib/simple_deploy/cli/attributes.rb