Skip to content

Instantly share code, notes, and snippets.

@baldowl
Created November 8, 2010 08:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baldowl/667489 to your computer and use it in GitHub Desktop.
Save baldowl/667489 to your computer and use it in GitHub Desktop.
Using Chef and Bundler Together
# Drop it in config/deploy/
#
# It's evaluated inside the deploy resource's context.
#
# It assumes Gemfile and Gemfile.lock are present and satisfy Bundler's
# requirements for the --deployment option.
current_release_directory = release_path
running_deploy_user = new_resource.user
bundler_depot = new_resource.shared_path + '/bundle'
excluded_groups = %w(development test)
script 'Bundling the gems' do
interpreter 'bash'
cwd current_release_directory
user running_deploy_user
code <<-EOS
bundle install --quiet --deployment --path #{bundler_depot} \
--without #{excluded_groups.join(' ')}
EOS
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment