Jakub Arnold Jakub Arnold - 11 months ago 50
Ruby Question

Capistrano deploy fails after I changed the repository URL

I have a simple deployment via capistrano from a Git repository. At first I was deploying form GitHub, everything worked just fine. But then I moved my repository to BitBucket and now I'm getting

fatal: Could not parse object '9cfb...'.

The problem goes away once I change

set :deploy_via, :remote_cache


set :deploy_via, :copy

but that doesn't fix the problem, it only bypasses it. Is there any way I can tell capistrano to just drop the old cache?

Answer Source

I gotta say I’m not sure, since I haven’t been able to test this but this should work:

cap deploy:cleanup -s keep_releases=0

Since it wipes every release (cache) from the server.

Apparently you will also need to remove shared/cached-copy, because this doesn’t seem to be cleaned by the Capistrano call above according to the comment below.