My servers don’t have access to external resources (gems, etc), so I manually run
bundle package
then upload the code and run
bundle install --local
How can I get the same behaviour out of Capistrano? Using the Bundler recipe, tries to install the bundles on the server. Whereas I’d like to;
On the build machine
- Checkout from SVN
- run bundle package
- zip and upload the artifact
On the application server
- Expand the Zip artifact
- run bundle install –local
- start the server
I tried
after("deploy:update_code") do
system("cd #{copy_cache} && bundle package")
end
But that runs the checkout and upload, there didn’t seem to be a place to attach after the checkout, but before the zip.
It seems the best way to do this is to, run bundle package on the development workstation, and then commit the bundled gems to source control, then run;