You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have X or more deployments fail (X being keep_releases-1)
Have a successful deployment
Expected behavior
Capistrano keeps (at least) the last known working release
Actual behavior
Last known working release gets deleted and failed releases are kept so there is no working release to roll back to if necessary
Arguably keep_releases should apply to successful and failed deployments separately (or there should be separate configuration options for these cases). I went through the code a bit and from what I can see (not very familiar with Ruby) capistrano doesn't seem to discern between failed and successful deployments for cleanup and rollback at all, which, to be honest, seems a bit strange to me for a deployment tool.
The text was updated successfully, but these errors were encountered:
Hi @tminich, thanks for the report and apologies for the lack of response.
capistrano doesn't seem to discern between failed and successful deployments for cleanup and rollback at all
That's correct. Capistrano does not have any way to mark a deployment as succeeded or failed. This is why keep_releases does not distinguish which releases get deleted.
I think this is a long-standing design decision and predates my time with Capistrano.
However, I definitely understand that this behavior could be surprising. Perhaps it should be documented somewhere? I would be open to accepting a PR that updates the keep_releases section of the documentation, for example.
Steps to reproduce
keep_releases
-1)Expected behavior
Capistrano keeps (at least) the last known working release
Actual behavior
Last known working release gets deleted and failed releases are kept so there is no working release to roll back to if necessary
Arguably
keep_releases
should apply to successful and failed deployments separately (or there should be separate configuration options for these cases). I went through the code a bit and from what I can see (not very familiar with Ruby) capistrano doesn't seem to discern between failed and successful deployments for cleanup and rollback at all, which, to be honest, seems a bit strange to me for a deployment tool.The text was updated successfully, but these errors were encountered: