cloudfoundry/cloud_controller_ng — pull request #85 by julz (2013-09-02 13:15:41+00:00)
Title: Delete app's droplet and buildpack cache when the app is deleted

Currently the buildpack cache associated with an app is not removed when
an app is deleted. This ends up filling up space on the blob store. For
deployments using local disk for the store this can lead to running out
of disk space (we've hit this a lot!).

Additionally, the move to soft deletion in app.rb means the after_destroy_commit
callback was never being called, leading to no droplet cleanup taking
place at all.

This change explicitly calls after_destroy_commit after soft deletion
and adds tests to ensure the droplet/buildpack are cleaned up after a
soft deletion. Also this change adds methods to StagingsController and
AppManager to delete the buildpack cache associated with an App,
and calls them when the app is deleted.