module Evrone module CI module Worker class Runner class Local include Worker::Helper::Logger include Worker::Helper::Config include Common::Helper::Shell attr_reader :build, :path, :build_script def initialize(build, path) @build = build @path = path @build_script = path.tmp_dir.join(".build.sh").expand_path end def perform make_build_script run_build_script end private def run_build_script bash file: build_script, chdir: path.work_dir, &method(:add_output) end def make_build_script content = build.travis.to_queue.to_shell_script script_replaces do |env| prepare_env env end write_file build_script, content, 0755 add_output_command build_script end def script_replaces { "SHARED_PATH" => path.shared_dir } end def prepare_env(env) env['init'].unshift "echo 'copy repo from #{path.repo_dir} to #{path.work_dir}'" env['init'].unshift build.csm.make_export_command path.repo_dir, path.work_dir env end end end end end end