New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes Bug #1810 removal of old releases #1811
Conversation
LGTM, I find the guard against unknown dir names to be robust enough for a feature I'm not deeply invested in. Can merge when ready, if I get a +1 from Matt or Will |
This looks good to me! We probably need a changelog entry. |
@@ -148,8 +148,10 @@ namespace :deploy do | |||
desc "Clean up old releases" | |||
task :cleanup do | |||
on release_roles :all do |host| | |||
releases = capture(:ls, "-xtr", releases_path).split | |||
if releases.count >= fetch(:keep_releases) | |||
releases = capture(:ls, "-x", releases_path).split |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you have removed the -r
flag, doesn't that mean the releases are no longer in reverse order? If so, the Ruby code for choosing which releases to delete needs to be flipped, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I didn't understand as well. But as it seems. ls -t
sorts in another direction than expected (at least for me it is) see: http://man7.org/linux/man-pages/man1/ls.1.html
So newest items will be listed first, thats why the r
is involved, just because the t
flag was used.
In the new situation we're sorting on folder names in alphabetical order which results in the newest folders to be in the end of the array, but just based on title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right. Makes sense.
Please add a CHANGELOG entry, and then this will be good to merge. Thanks! ✨ |
Generated by 🚫 danger |
Looks good. Thanks again! 🙇 |
np, glad I could help :-) |
No description provided.