Sha256: 7219f7c25740eb7510b98f8ca44743392d6f60467d0334718adecacd3ab0c733

Contents?: true

Size: 606 Bytes

Versions: 3

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

require_relative '../command'
require_relative './attach'

module Dru
  module Commands
    class Up < Dru::Command
      def initialize(options:)
        @options = options
      end

      def execute(input: $stdin, output: $stdout)
        start_docker_compose
        return if options[:detach]

        attach_to_default_container
      end

      private

      def start_docker_compose
        run_docker_compose_command('up', '-d')
      end

      def attach_to_default_container
        Attach.new(options: { container: 'app' }).execute
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dru-0.6.0 lib/dru/commands/up.rb
dru-0.5.2 lib/dru/commands/up.rb
dru-0.5.1 lib/dru/commands/up.rb