Capistrano with Subversion

Rough notes on how to set up Capistrano to deploy with Subversion.

Note: Must get capistrano to use svn export instead of checkout, or use rsync.


Or, note last comment on nobugs page:

Capistrano 2.0 fixes this. You can do:

set :deploy_via, :copy
set :copy_strategy, :export

And it will only send a tarball of your exported sources up.

Set up svn and key for ssh, then follow these guides…

Must create config directory if not a rails app (no need to add it to svn yet).

Had to add line to deploy.rb to prevent error message.

# Necessary to prevent "*** [err ::] stdin: is not a tty" error on 'cap deploy:setup'.
default_run_options[:pty] = true 


Note: Check whether this error message actually prevents the content being added to the server.

Must create script directory if not a rails app (and add it to svn so we can do the propset).

If not a rails app, you won’t have [site root]/current/script/process/spawner

In the messages returned by cap deploy:cold, errors are preceeded by 2 stars ** (as are some non-error messages).

  • Got a few errors about not being able to create rails-related files (public/images etc).
  • Any rake tasks will fail, e.g. rake RAILS_ENV=production db:migrate
  • deploy:start will fail when it tries to run the script/spin command because it tries to use sudo and the user is not in the sudoers file.

The .svn directory will be copied to the server. To prevent this, add the following to deploy.rb:

set :copy_strategy, :export


Last modified: 05/06/2008 Tags: ,

Related Pages

Other pages possibly of interest:

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top