Files
dokku/plugins/apps/post-delete
2015-09-15 02:16:40 -07:00

13 lines
506 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_PATH/available/common/functions"
APP="$1"; IMAGE_REPO=$(get_app_image_repo $APP)
[[ -n $APP ]] && rm -rf "$DOKKU_ROOT/$APP" > /dev/null
# remove all application containers & images
# shellcheck disable=SC2046
docker rm -f $(docker ps -a --no-trunc | egrep "dokku/${APP}:" | awk '{ print $1 }' | xargs) &>/dev/null || true
# shellcheck disable=SC2046
docker rmi $(docker images -q $IMAGE_REPO | xargs) &>/dev/null || true