Clear environment variables before running hooks
Merge request reports
Activity
mentioned in issue gitlab-workhorse#58 (closed)
1 1 require 'open3' 2 require 'bundler' We cannot do this here. gitlab-shell only uses stdlib
Hm, I tried this on omnibus installation and locally (for all three types of pushes)
Edited by Valery SizovAs a general rule we don't use gems in gitlab-shell. I think this is because it can be unpredictable which Ruby runtime is invoked by
#!/usr/bin/env ruby
on installations from source.In Omnibus we do not have this problem because we patch all gitlab-shell executables at build time: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/config/templates/gitlab-shell/ruby_script_wrapper.erb
If we invoke from lib/gitlab/git/hook.rb in gitlab-rails we should do the Bundler.with_clean_env there.
@vsizov try
head /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell
to see what the patching does.
Closed in favor of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6344
@jacobvosmaer-gitlab Thanks for your time and help