- Download the latest stack-auditor from the release section of this repository for your operating system.
- Install the plugin with
cf install-plugin <path_to_binary>
.
Prerequisite: Have a working golang environment with correctly set
GOPATH
.
go get github.com/cloudfoundry/stack-auditor
cd $GOPATH/src/github.com/cloudfoundry/stack-auditor
./scripts/build.sh
Install the plugin with cf install-plugin <path_to_binary>
or use the shell scripts ./scripts/install.sh
or ./scripts/reinstall.sh
.
- Audit cf applications using
cf audit-stack [--csv | --json]
. These optional flags return csv or json format instead of plain text. - Change stack association using
cf change-stack <app> <stack>
. This will attempt to perform a zero downtime restart. Make sure to target the space that contains the app you want to re-associate. - Delete a stack using
cf delete-stack <stack> [--force | -f]
Target a cloudfoundry with the following prerequisites:
- has cflinuxfs3 and cflinuxfs4 stacks and buildpacks
- If using cf-deployment, this can be enabled with the ops file
operations/experimental/add-cflinuxfs4.yml
- If using cf-deployment, this can be enabled with the ops file
- you are targeting an org and a space
Then run:
./scripts/all-tests.sh
The integration tests require a Cloud Foundry environment with both cflinuxfs3 and cflinuxfs4 stacks and their corresponding buildpacks available. To enable the workflow, you need to configure the following secrets in your GitHub repository:
CF_API
- The Cloud Foundry API endpointCF_ORG
- The Cloud Foundry organization nameCF_SPACE
- The Cloud Foundry space nameCF_USERNAME
- The Cloud Foundry usernameCF_PASSWORD
- The Cloud Foundry password
These credentials should have sufficient permissions to:
- Access the target org and space
- Create and manage applications
- Create and manage stacks
- Create and manage buildpacks