Created
November 30, 2017 20:22
-
-
Save aprice/7995b5c4adf78a0bf4335e9cf6d00cc4 to your computer and use it in GitHub Desktop.
Simple utility for showing/cleaning up kitchen test instances that may have been forgotten.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# mrclean - list kitchen instances in all cookbooks | |
# mrclean destroy - destroy kitchen instances in all cookbooks | |
# Update to your cookbook path | |
CBDIR=$HOME/chef-repo/cookbooks | |
for c in $CBDIR/*; do | |
echo $(basename $c) | |
cd $c | |
if [[ $1 == "destroy" ]]; then | |
kitchen destroy | |
else | |
kitchen list | grep -v "Not Created" | |
fi | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment