Sha256: 276ed8a6071ee2f645325778a3ce07749bba23fefa94338afa93d3778ee30e0f

Contents?: true

Size: 648 Bytes

Versions: 21

Compression:

Stored size: 648 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)

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

        def id
          container.id
        end

      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
vx-container_connector-0.3.0 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.9 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.8 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.7 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.6 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.5 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.4 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.3 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.2 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.1 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre38 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre37 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre36 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre35 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre34 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre33 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre32 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre31 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre30 lib/vx/container_connector/docker/spawner.rb
vx-container_connector-0.2.0.pre29 lib/vx/container_connector/docker/spawner.rb