This removes the entire directory of the last deployment rather than just the /archive sub-directory. Without this disks are filling up fast because the bundle.zip and /logs still remain. Those bundles are usually quite big. 5-10 deployments is enough to use up over a gigabyte of disk in some cases.
Note: Ideally we would clear away all directories which are not the latest successful deployment because, even with this PR, failed deployments will still remain.. But that's a larger change and I'm not familiar enough with this code. Suggested changes to this PR are more than welcome.
This removes the entire directory of the last deployment rather than just the /archive sub-directory. Without this disks are filling up fast because the bundle.zip and /logs still remain. Those bundles are usually quite big. 5-10 deployments is enough to use up over a gigabyte of disk in some cases.
Note: Ideally we would clear away all directories which are not the latest successful deployment because, even with this PR, failed deployments will still remain.. But that's a larger change and I'm not familiar enough with this code. Suggested changes to this PR are more than welcome.