Skip to content

Instantly share code, notes, and snippets.

@jzaccone
Created February 16, 2017 13:36
Show Gist options
  • Save jzaccone/b48aac0893d891ca62b784d958b1fb2f to your computer and use it in GitHub Desktop.
Save jzaccone/b48aac0893d891ca62b784d958b1fb2f to your computer and use it in GitHub Desktop.
Clean up your OpenWhisk environment including packages, triggers, actions and rules
#!/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