Commit 1a1da859 authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Wrap gitlab-runner executables to fix the PATH

parent 46731295
......@@ -34,4 +34,15 @@ build do
runner_install_dir = "#{install_dir}/embedded/service/gitlab-runner"
command "mkdir -p #{runner_install_dir}"
sync project_dir, runner_install_dir, exclude: '.git'
block do
env_shebang = "#!/usr/bin/env ruby"
`grep -r -l '^#{env_shebang}' #{project_dir}`.split("\n").each do |ruby_script|
script = File.read(ruby_script)
erb :dest => ruby_script.sub(project_dir, "#{install_dir}/embedded/service/gitlab-runner"),
:source => "ruby_script_wrapper.erb",
:mode => 0755,
:vars => {:script => script, :install_dir => install_dir}
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment