diff options
author | Amol Shinde <amol.shinde@msystechnologies.com> | 2019-08-23 17:35:09 +0530 |
---|---|---|
committer | Amol Shinde <amol.shinde@msystechnologies.com> | 2019-09-04 14:42:21 +0530 |
commit | 498e8aebb6791426e8915684421591e544c9fad4 (patch) | |
tree | 2a87deb5ec1942cbceb126a94ea18ee8ca6e8f1f /lib/chef/cookbook | |
parent | dd0009d7e77f192cadb1632f2159a6dbc880980f (diff) | |
download | chef-498e8aebb6791426e8915684421591e544c9fad4.tar.gz |
Added support to provide additional options to bundle install
- Added option to skip gem metadata installation
- Added test cases for gem installer
Signed-off-by: Amol Shinde <amol.shinde@msystechnologies.com>
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r-- | lib/chef/cookbook/gem_installer.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/cookbook/gem_installer.rb b/lib/chef/cookbook/gem_installer.rb index eab4b47241..cf0177d1d5 100644 --- a/lib/chef/cookbook/gem_installer.rb +++ b/lib/chef/cookbook/gem_installer.rb @@ -66,8 +66,13 @@ class Chef tf.close Chef::Log.trace("generated Gemfile contents:") Chef::Log.trace(IO.read(tf.path)) - so = shell_out!("bundle install", cwd: dir, env: { "PATH" => path_with_prepended_ruby_bin }) - Chef::Log.info(so.stdout) + # Skip installation only if Chef::Config[:skip_gem_metadata_installation] option is true + unless Chef::Config[:skip_gem_metadata_installation] + # Add additional options to bundle install + cmd = [ "bundle", "install", Chef::Config[:gem_installer_bundler_options] ] + so = shell_out!(cmd, cwd: dir, env: { "PATH" => path_with_prepended_ruby_bin }) + Chef::Log.info(so.stdout) + end end end Gem.clear_paths |