I know that I can use
keep_releases to keep a specific number of releases, but I have a series of releases that have symlinks to them. For example, I have:
http://www.example.com/version/1.0.0 which is a symlink to some release, say
/var/www/example.com/releases/2019050101. I also have a series of what I'd call "transient" releases, which are linked using
/current/. When one of these 'transient' releases is deployed, the
/current symlink is overwritten to the most current release. What this amounts to is that there are some releases that don't have symlinks to them.
What I'd like to do is specify to Capistrano to only keep
keep_releases number of these transient releases. In other words, all releases that are symlinked from the root directory should always be kept.
Can someone help me with a Capistrano recipe for accomplishing this?