Joshua J. Kugler wrote:
We're deploying our sites to Windows 2003 (via Cygwin) and have run across a problem where a directory is being held open by the web server, causing the "rm -rf" stage of the keep releases method to fail, thus causing the deployment to fail.

How might we modify (or override) that process to ignore that error. The file is released eventually, so would be deleted eventually, but we want to ignore the error until it is deleted.

Feel free to point me to the appropriate documentation. :)

Thanks!

j

Hi Joshua,

  You could override clean_up task to delete with proper commands:

namespace :deploy do
 desc <<-DESC
Clean up old releases. By default, the last 5 releases are kept on each \ server (though you can change this with the keep_releases variable). All \ other deployed revisions are removed from the servers. By default, this \ will use sudo to clean up the old releases, but if sudo is not available \
   for your environment, set the :use_sudo variable to false instead.
 DESC
 task :cleanup, :except => { :no_release => true } do
   count = fetch(:keep_releases, 5).to_i
   if count >= releases.length
     logger.important "no old releases to clean up"
   else
     logger.info "keeping #{count} of #{releases.length} deployed releases"

     directories = (releases - releases.last(count)).map { |release|
       File.join(releases_path, release) }.join(" ")

try_sudo "rm -rf #{directories}" # XXX - Joshua replace it with your desired command
   end
 end
end

Regards

PS: I'll think about a generic solution to *nix/windows worlds

--
Rafa

--
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to