zendesk / samson

Web interface for deployments, with plugin architecture and kubernetes support
Other
1.45k stars 234 forks source link

PATH in builds #3262

Open patrobinson opened 5 years ago

patrobinson commented 5 years ago

As per https://github.com/zendesk/samson/issues/2744 the PATH variable leaks into our jobs and this can impact using rbenv. When samson is launched with bundle exec puma, it prepends the directory /var/www/samson/releases/1/vendor/bundle/ruby/2.5.0/bin to the PATH.

It appears this issue was introduced in 2bf25bdfb123b4e12997ee3e49e7eee5789b955c Previously we were calling:

Bundler.with_clean_env do
  PTY.spawn(...)
end

This strips the path prepended by bundle exec and hence avoids conflicts with rbenv.

Should we re-introduce Bundler.with_clean_env to strip the PATH?

cc @grosser

grosser commented 5 years ago

kk, fix coming in a week or so ... PR welcome if you know how to fix