Capistrano::FastDeploy
A couple Capistrano tweaks to speed up deploys:
- All changes occur in
currentfolder, git clones directly to this folder and usesresetto deploy. - Symlinks in
deploy:finalize_updateall happen in one ssh connection - Rollback uses git as well
This overrides the following default capistrano tasks:
deploy:update_cod- Usesgit resetinstead of the standard:scmand:deploy_viaproviders.deploy:finalize_update- Concatenates all symlink commands fromshared_children into a single ssh command. Also adds support formapped_shared_children` so you can add additional symlinks like this:
set :mapped_shared_children, {
'config/database.yml' => 'config/database.yml'
}
deploy:create_symlink- This is now a no-op, there are no longer individual release directories.deploy:rollback,deploy:rollback:repo,deploy:rollback:cleanup- Goes back to the previous place thatHEADwas pointing (HEAD@{1}). You don't want to do this if you go and monkey around with yourcurrentfolder manually.deploy:create_symlink- This is now a no-op, there are no longer individual release directories.
Installation
Add this line to your application's Gemfile:
gem 'capistrano-fast_deploy'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-fast_deploy
Usage
Add the following to your deploy.rb:
require 'capistrano/fast_deploy'
Upgrading an existing project
It should just work automatically. deploy:update_code will "unsymlink"
your current directory. After that you can safely delete your releases
folder if you like.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request