Sha256: d4280b92a46ff9ed5992dabecf79f83e8c61deb74fa445fcf3e5f4267ef9d413

Contents?: true

Size: 659 Bytes

Versions: 13

Compression:

Stored size: 659 Bytes

Contents

module Vx
  module ContainerConnector

    class Docker

      class Spawner
        attr_reader :container, :ssh, :work_dir

        def initialize(container, ssh, work_dir)
          @container  = container
          @ssh        = ssh
          @work_dir   = work_dir
        end

        def spawn(*args, &logger)
          env     = args.first.is_a?(Hash) ? args.shift : {}
          options = args.last.is_a?(Hash)  ? args.pop   : {}
          cmd     = args

          options.merge!(chdir: work_dir, pty: true)

          ssh.spawn(env, cmd, options, &logger)
        end

        def id
          container.id
        end

      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vx-container_connector-0.5.7 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.5.6 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.5.5 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.5.4 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.5.3 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.5.2 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.5.1 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.5.0 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.4.3 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.4.2 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.4.1 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.4.0 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.3.1 lib/vx/container_connector/docker/spawner.rb