Deploy with Rsync from any local (or remote) repository when using Capistrano. Capistrano v3 ready!
Deploy with Rsync to your server from any local (or remote) repository when using Capistrano. Saves you from having to install Git on your production machine and allows you to customize which files you want to deploy. Also allows you to easily precompile things on your local machine before deploying.
gem install capistrano-rsync
Require it at the top of your
ruby require "capistrano/rsync"
rsync_optionsto your liking:
ruby set :rsync_options, %w[--recursive --delete --delete-excluded --exclude .git*]
And after setting regular Capistrano options, deploy as usual!
tmp/deploy) on your local machine.
branchvariable (defaults to
rsync_cacheset (defaults to
shared/deploy), rsyncs to that directory on the server.
rsync_cacheset, copies the content of that directory to a new release directory.
nil, rsyncs straight to a new release directory.
After that, Capistrano takes over and runs its usual tasks and symlinking.
If you don't want to deploy everything you've committed to your repository, pass some
--excludeoptions to Rsync:
ruby set :rsync_options, %w[ --recursive --delete --delete-excluded --exclude .git* --exclude /config/database.yml --exclude /test/*** ]
rsync:stagebefore rsyncing. Hook to that like this: ```ruby task :precompile do Dir.chdir fetch(:rsync_stage) do system "rake", "assets:precompile" end end
after "rsync:stage", "precompile" ```
Set Capistrano variables with
set name, value.
|The path or URL to a Git repository to clone from.
|The Git branch to checkout.
|Path where to clone your repository for staging, checkouting and rsyncing. Can be both relative or absolute.|
|Path where to cache your repository on the server to avoid rsyncing from scratch each time. Can be both relative or absolute.
nilif you want to disable the cache.
|Array of options to pass to
Capistrano::Rsync is released under a Lesser GNU Affero General Public License, which in summary means:
For more convoluted language, see the