Sha256: a8d8b6068c1bcd7e039dc5abadce1c0f50b3d803ee92323c8bc7594f3b2d00f2
Contents?: true
Size: 1.01 KB
Versions: 2
Compression:
Stored size: 1.01 KB
Contents
require 'open3' module Percheron module Actions class ExecLocal include Base def initialize(container, scripts, description) @container = container @scripts = scripts @description = description end def execute! $logger.debug "Executing #{description} scripts '#{scripts.inspect}' locally" execute_scripts! end private attr_reader :container, :scripts, :description def execute_scripts! scripts.each do |script| in_working_directory(base_dir) do execute_command!('/bin/bash -x %s 2>&1' % Pathname.new(File.expand_path(script))) end end end def execute_command!(command) $logger.info "Executing #{description} '#{command}' locally" Open3.popen2e(command) do |stdin, stdout_stderr, wait_thr| while line = stdout_stderr.gets $logger.debug line.strip end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
percheron-0.6.3 | lib/percheron/actions/exec_local.rb |
percheron-0.6.2 | lib/percheron/actions/exec_local.rb |