We are using DeploymentManager on a set of servers for different deployments.
In one of the cases the problem of not cleaning up Temp folder by DeploymentAgent becomes a showstopper.
A little bit of details. There is a database server. Server hosts 2 databases that are subject for deployment. One database is redeployed using nupack generated by RedGate SQL Server plugin for TeamCity. Another database is updated by 2 custom made nupacks. All 3 packages belong to 3 different Projects. All projects have different set of variables defined. RedGate nupack contains PreDeploy.ps1. 2 custom nupacks contain Deploy.ps1. Because the Temp folder is not cleaned up by the Agent there are always mix of the packages there and they fail as DeploymentManager tries to run PreDeploy.ps1 then Deploy.ps1 which in fact belong to 2 different packages and expect different variables.
Any advice on how to clean Temp folder before or after deployment?