Advanced Tentacle cleanup for deleted Octopus items
Currently retention policies will only run on a Tentacle during a deployment and only for the project currently deploying. There are cases where you delete a project, channel or tenant meaning even if a deployment is run on the Tentacle those previous releases will never be deleted.
The idea being raises will give the ability for a cleanup process to be run on an environment for all active machines. It will compare existing projects, tenants (etc where relevant) against the deployment journal and if there are records in the deployment journal that cannot be matched to the triggering instance those deployments will be cleaned up.
It cannot account for anything not found in the deployment journal. There will be no directory searching inside known Octopus folders. This will work as the retention policy now does and clean up packages, package cache, and package extract folders.
'Existing projects' would be any project still in Octopus. It would compare projects found in the deployment journal on the Tentacle and determine if that project is still in Octopus. If it is found it would leave that entry and those files alone, if the project was not found it would remove the entry and corresponding files.
What is your definition of existing projects? I need a way to clean up retired applications from the tentacle. It is a security issue, for us to leave these around on disk.
Rosti Grigoriev commented
This type of cleanup if very important when tenants are used for managing deployments of git topic branches. Due to the highly transient nature of git topic branches, we have to go through the manual and error prone process of deleting orphaned packages and package extract folders quite often, usually after getting "insufficient space" error message.