How to Safely Clean Up Old Webapp Directories with a Groovy CI Script
This article explains how to write a Groovy script for a CI pipeline that lists webapp directories on a Linux server, keeps the newest four, sorts them by modification time, and deletes the older ones using sudo to overcome permission issues, complete with full source code.
