Class: Vx::Lib::Container::Local::Spawner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Upload

#upload

Instance Attribute Details

#work_dirObject

Returns the value of attribute work_dir

Returns:

  • (Object)

    the current value of work_dir



9
10
11
# File 'lib/vx/lib/container/local/spawner.rb', line 9

def work_dir
  @work_dir
end

Instance Method Details

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



13
14
15
16
17
18
# File 'lib/vx/lib/container/local/spawner.rb', line 13

def exec(script, options = {}, &logger)
  Dir.chdir work_dir do
    sh.exec upload(script, "~/build.sh", mode: '0755'), options.merge(home: work_dir)
    sh.exec("~/build.sh", options.merge(home: work_dir), &logger)
  end
end

#idObject



20
21
22
# File 'lib/vx/lib/container/local/spawner.rb', line 20

def id
  work_dir
end

#propertiesObject



24
25
26
# File 'lib/vx/lib/container/local/spawner.rb', line 24

def properties
  {}
end