This is a Concourse pipeline that deletes all apps in Cloud Foundry at 2am on a Saturday.
Copy credentials-sample.yml
in to credentials.yml
and edit the fields (this file is self-documenting).
Then add it to concourse using the following CLI:
fly -t concourse-server set-pipeline -p pcf-wipedown -c pipeline.yml -l credentials.yml
The script is merciless and will just delete everything that doesn't:
- End in a
-keep
suffix - Exist in an org specified in
PAS_SAFE_ORGS
- Exist in a space specified in
PAS_SAFE_SPACES
- Exist in the System org
Routes will be automatically cleared regardless if they're not being used (i.e. associated with an app).