Wolfmans Howlings

A programmers Blog about Programming solutions and a few other issues

Updated Capistrano local subversion and perforce

Posted by Jim Morris on Sun Feb 18 15:32:14 -0800 2007

I have updated the Capistrano local subversion module and added a perforce one.

The original article is here.

I have added rsync as an option to speed up the deployment to remote servers, To use that option install this version, in the example below I have installed the file into my rails projects lib/tasks directory.

When the rsync option is set the deployment method will use rsync over ssh to synchronize between a local cache of the subversion project and a remote cache, minimizing the amount of data uploaded to the server.

To use rsync use this in the deploy.rb...

  require 'lib/tasks/local_subversion_rsync.rb'
  set :scm, Capistrano::SCM::LocalSubversionRsync

  set :repository_is_not_reachable_from_remote, true
  set :use_rsync, true
  set :local_rsync_cache, "/home/user/projects/aproject/cache"
  set :remote_rsync_cache, "/var/www/webapp/cache"

  set :rsync_username, "ausername"
  set :rsync_excludes, ["*.bak", "*.log"]

The rsync_username and rsync_excludes are optional.

The :rsync_username option sets the username that ssh uses to login to use rsync. Leave it blank if it is the same as your current login name.

The :rsync_excludes option allows you to pass --exclude options to rsync, using the rsync syntax for exclusions, this is an array of patterns to exclude.

Note you must do a local SVN checkout to the directory specified by local_rsync_cache at least once before using this method.

Also the directory specified by remote_rsync_cache must exist on the server.

The perforce version of the scm module that allows the perforce server to be accessed locally only is here, note that this does not currently support the rsync option or write to the revisions.log.

Posted in Rails  |  Tags capistrano  |  1 comments


  1. wolfmanjm said on Wed Feb 21 14:08:18 -0800 2007
    I have released a new version that fixes the bug where the revisions.log file was not being updated

(leave email »)