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.

rsync: http://fiatdev.com/2006/07/15/capistrano-deployment-using-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.

http://blog.holgerkohnen.de/2007/05/deploying-with-capistrano-copy-method.html


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 :: example.com] stdin: is not a tty" error on 'cap deploy:setup'.
default_run_options[:pty] = true 

(see http://groups.google.com/group/capistrano/browse_thread/thread/42e12b2110af2e29)

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

http://articles.slicehost.com/2008/1/22/capistrano-series-configuring-capistrano-2

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

http://articles.slicehost.com/2008/1/23/capistrano-series-application-vhost-creation

n/a


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