Sha256: a6e239c1fe7d30c47c503eec76b479bd49c06e26b525a4c4d9b2982ff4fb4772

Contents?: true

Size: 1.5 KB

Versions: 2

Compression:

Stored size: 1.5 KB

Contents

module Percheron
  module Commands
    class Console < Abstract

      parameter('STACK_NAME', 'stack name', required: false)

      def execute
        super
        require 'pry-byebug'
        pry
      end

      private

        # FIXME: Dupe?
        def list
          Stack.get(config, stack_name).each do |_, stack|
            puts("\n", Percheron::Formatters::Stack::Table.new(stack).generate)
          end
          nil
        end

        def logs(container_name, follow: false)
          stack.logs!(container_name, follow: follow)
          nil
        end

        def shell(container_name)
          stack.shell!(container_name)
          nil
        end

        def purge(container_names)
          stack.purge!(container_names: [ *container_names ])
          nil
        end

        def create(container_names, start: false)
          stack.create!(container_names: [ *container_names ], start: start)
          nil
        end

        def recreate(container_names, start: false)
          stack.create!(container_names: [ *container_names ], start: start)
          nil
        end

        def start(container_names)
          stack.start!(container_names: [ *container_names ])
          nil
        end

        def stop(container_names)
          stack.stop!(container_names: [ *container_names ])
          nil
        end

        def restart(container_names)
          stack.restart!(container_names: [ *container_names ])
          nil
        end

        alias_method :status, :list
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
percheron-0.7.6 lib/percheron/commands/console.rb
percheron-0.7.5 lib/percheron/commands/console.rb