Sha256: 2c3637b919f1bb140b5424f0ebef19d165565aa7e439d8b952b0f7ca500246dd

Contents?: true

Size: 852 Bytes

Versions: 2

Compression:

Stored size: 852 Bytes

Contents

module Minke
  module Tasks
    class Shell < Task

      def run args = nil
        @logger.info "## Run shell" 
        @logger.info "## Run application with docker compose"

        compose_file = @config.compose_file_for(@task_name)
        compose_file = File.expand_path(compose_file)
        compose = @docker_compose_factory.create compose_file unless compose_file == nil
        
        run_with_block do |pre_tasks, post_tasks|
          begin
            compose.up
            pre_tasks.call
            @logger.info "## Shell open to build container"
            run_command_in_container('/bin/sh', true)
          rescue SystemExit, Interrupt
            @logger.info "Stopping...."
            raise SystemExit
          ensure
            compose.down
            post_tasks.call
          end
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
minke-1.14.1 lib/minke/tasks/shell.rb
minke-1.14.0 lib/minke/tasks/shell.rb