Skip to content
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

Merged
merged 4 commits into from Dec 7, 2016

Conversation

markri
Copy link
Contributor

@markri markri commented Dec 5, 2016

No description provided.

@leehambley
Copy link
Member

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

@will-in-wi
Copy link
Contributor

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
Copy link
Member

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?

Copy link
Contributor Author

@markri markri Dec 6, 2016

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

Copy link
Member

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.

@mattbrictson
Copy link
Member

Please add a CHANGELOG entry, and then this will be good to merge. Thanks! ✨

@capistrano-bot
Copy link

capistrano-bot commented Dec 7, 2016

1 Warning
⚠️ There are code changes, but no corresponding tests. Please include tests if this PR introduces any modifications in capistrano’s behavior.

Generated by 🚫 danger

@mattbrictson
Copy link
Member

Looks good. Thanks again! 🙇

@mattbrictson mattbrictson merged commit 199b785 into capistrano:master Dec 7, 2016
@markri
Copy link
Contributor Author

markri commented Dec 7, 2016

np, glad I could help :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants