Created
February 16, 2017 13:36
-
-
Save jzaccone/b48aac0893d891ca62b784d958b1fb2f to your computer and use it in GitHub Desktop.
Clean up your OpenWhisk environment including packages, triggers, actions and rules
This file contains 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 | |
# This script deletes all wsk actions, packages, triggers and rules | |
# May need to run it twice to delete everything | |
IFS=' | |
' | |
context="packages" | |
for line in `wsk list | awk '{ print $1 }' | tail -n +2`; do | |
if [ $line == "packages" ] || [ $line == "actions" ] || [ $line == "triggers" ] || [ $line == "rules" ]; then | |
context=${line%?} #Take off last 's' for command | |
continue | |
fi | |
wsk $context delete $line | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment