Sha256: 2d987616f56001186ba638e20ff573878ca35829f67a34839ad7122955bc704f

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 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

        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
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
percheron-0.7.4 lib/percheron/commands/console.rb
percheron-0.7.3 lib/percheron/commands/console.rb
percheron-0.7.2 lib/percheron/commands/console.rb
percheron-0.7.1 lib/percheron/commands/console.rb
percheron-0.7.0 lib/percheron/commands/console.rb