I've been using Capistrano to deploy for a while, but always with the SVN repository on a different machine from the production host I'm deploying to.
Now I have a situation where the repository and the production machine are the same. Here is my deploy.rb
file...
set :application, 'my_app'
set :repository, "file:///home/ethan/svn/my_app/trunk"
set :deploy_to, "/var/www/#{application}"
set :use_sudo, false
role :app, 'ethan@my_production_host.com'
namespace :deploy do
task :start, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
task :stop, :roles => :app do
# Do nothing.
end
desc "Restart Application"
task :restart, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
end
Here's what Capistrano returns when I try to deploy (I'm running this command on my development machine)...
$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction开发者_开发知识库: start
* executing `deploy:update_code'
executing locally: "svn info file:///home/ethan/svn/my_app/trunk -rHEAD"
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///home/ethan/svn/my_app/trunk'
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/my_app/releases/20110919111200; true"
servers: ["my_production_host.com"]
[ethan@my_production_host.com] executing command
command finished
Command svn info file:///home/ethan/svn/my_app/trunk -rHEAD returned status code 256
Any suggestions?
You will have to use the local_repository
option as is documented here: https://github.com/capistrano/capistrano/wiki/2.x-Significant-Configuration-Variables.
精彩评论