Skip to content

Instantly share code, notes, and snippets.

@nevans
Created January 6, 2011 15:36
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nevans/768022 to your computer and use it in GitHub Desktop.
Save nevans/768022 to your computer and use it in GitHub Desktop.
how to use private git repos with bundler at Engine Yard
# put this into your config/eydeploy.rb
def bundle
if File.exist?("#{c.release_path}/Gemfile")
info "~> Gemfile detected, bundling gems"
lockfile = File.join(c.release_path, "Gemfile.lock")
bundler_installer = if File.exist?(lockfile)
get_bundler_installer(lockfile)
else
warn_about_missing_lockfile
bundler_09_installer(default_09_bundler)
end
sudo "#{$0} _#{EY::Serverside::VERSION}_ install_bundler #{bundler_installer.version}"
####################################################
# this is the only line that has been changed:
#run "cd #{c.release_path} && bundle _#{bundler_installer.version}_ install #{bundler_installer.options}"
run "exec ssh-agent bash -c 'ssh-add /home/deploy/.ssh/#{c.app}-deploy-key && cd #{c.release_path} && bundle _#{bundler_installer.version}_ install #{bundler_installer.options}'"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment