Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [Unreleased]
### Fixed
* Drop support for Ruby 3.1 and 3.2, Rails 7.0
* Capistrano: deployment should continue even if cleanup cannot delete files

## 7.3.6 / 2026-01-13
### Added
Expand Down
10 changes: 10 additions & 0 deletions lib/ndr_dev_support/capistrano/restart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,15 @@
# The tmp/ directory should be shared, so this affects all prior deployments
run "touch #{shared_path}/tmp/restart.txt"
end

desc <<~DESC
Clean up old releases. Overrides the default deploy:cleanup but without blocking \
subsequent tasks if cleanup fails (e.g. because of locked files or permissions issues).
DESC
task :cleanup, except: { no_release: true } do
count = fetch(:keep_releases, 5).to_i
try_sudo "ls -1dt #{releases_path}/* | tail -n +#{count + 1} | #{try_sudo} xargs -r rm -rf " \
"|| echo 'cap deploy:cleanup failed - continuing, but check permissions.' >&2"
end
end
end