Run deploy:cleanup automatically?
ericclemmons opened this issue · 7 comments
This definitely makes sense for environments like staging
, where you're constantly previewing and not really rolling back.
But with the defaults being 5
or 10
, shouldn't this run all the time to ensure disk space isn't wasted?
I'm all for putting it onto the individual {{ env }}.rb
instead of behind the scenes, so users can remove it if necessary.
I think that may work. In the production environment, there should be at least the previous copy present in case of issues during deployment.
In staging, I think that there should be only the latest update of a branch whether it's master or any other.
Makes sense to me!
Something worth noting: we had a staging server that ran out of disk space with three branches deployed, each of which had 1, 5, and 12 releases respectively. Though a deploy:cleanup
was run (while on master
branch), it appears to have only cleaned up releases for that specific branch.
I'm guessing this was capistrano's intended functionality (though I can't yet find any documentation to corroborate), so we may want to make a note of it in our docs, if not add functionality to clean releases for all branches.
Thoughts, @ericclemmons?
So I'll make it such that staging only has 1 release, and production defaults to 3 releases.
@ericclemmons That would still only affect releases for the current branch, no?
Gotcha...so we should still probably add this to some sort of
troubleshooting doc