Class: Vx::Lib::Container::Docker::Spawner

Inherits:
Struct
  • Object
show all
Includes:
Lib::Shell, Upload
Defined in:
lib/vx/lib/container/docker/spawner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Upload

#upload

Instance Attribute Details

#containerObject

Returns the value of attribute container

Returns:

  • (Object)

    the current value of container



7
8
9
# File 'lib/vx/lib/container/docker/spawner.rb', line 7

def container
  @container
end

#sshObject

Returns the value of attribute ssh

Returns:

  • (Object)

    the current value of ssh



7
8
9
# File 'lib/vx/lib/container/docker/spawner.rb', line 7

def ssh
  @ssh
end

Instance Method Details

#exec(script, options = {}, &logger) ⇒ Object



12
13
14
15
# File 'lib/vx/lib/container/docker/spawner.rb', line 12

def exec(script, options = {}, &logger)
  sh(:ssh, ssh).exec upload(script, "~/build.sh", mode: '0755', &logger), options
  sh(:ssh, ssh).exec("~/build.sh", options, &logger)
end

#idObject



21
22
23
# File 'lib/vx/lib/container/docker/spawner.rb', line 21

def id
  container.id
end

#propertiesObject



25
26
27
# File 'lib/vx/lib/container/docker/spawner.rb', line 25

def properties
  container.json
end

#work_dirObject



17
18
19
# File 'lib/vx/lib/container/docker/spawner.rb', line 17

def work_dir
  "~/"
end