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, &logger) ⇒ Object



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

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

#idObject



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

def id
  container.id
end