class Vanagon::Engine::Local
Public Class Methods
new(platform, target = nil, **opts)
click to toggle source
Calls superclass method
Vanagon::Engine::Base::new
# File lib/vanagon/engine/local.rb, line 8 def initialize(platform, target = nil, **opts) # local engine can't be used with a target super(platform, 'local machine') # We inherit a set of required attributes from Base, # and rather than instantiate a new empty array for # required attributes, we can just clear out the # existing ones. @required_attributes.clear end
Public Instance Methods
build_host_name()
click to toggle source
Return the target name to build on
# File lib/vanagon/engine/local.rb, line 25 def build_host_name if @build_host_name.nil? validate_platform @build_host_name = @target end @build_host_name end
dispatch(command, return_output = false)
click to toggle source
Dispatches the command for execution
# File lib/vanagon/engine/local.rb, line 35 def dispatch(command, return_output = false) Vanagon::Utilities.local_command(command, return_command_output: return_output) end
name()
click to toggle source
Get the engine name
# File lib/vanagon/engine/local.rb, line 20 def name 'local' end
retrieve_built_artifact(artifacts_to_fetch, no_packaging)
click to toggle source
# File lib/vanagon/engine/local.rb, line 43 def retrieve_built_artifact(artifacts_to_fetch, no_packaging) output_path = 'output/' FileUtils.mkdir_p(output_path) unless no_packaging artifacts_to_fetch << "#{@remote_workdir}/output/*" end artifacts_to_fetch.each do |path| FileUtils.cp_r(Dir.glob(path), "output/") end end
ship_workdir(workdir)
click to toggle source
# File lib/vanagon/engine/local.rb, line 39 def ship_workdir(workdir) FileUtils.cp_r(Dir.glob("#{workdir}/*"), @remote_workdir) end