allow tagging and deployment of tagged app images

This commit is contained in:
Michael Hobbs
2015-06-10 14:21:47 -07:00
parent 03165ee3f8
commit 04a4da7fc5
16 changed files with 300 additions and 102 deletions

View File

@@ -19,11 +19,10 @@ case "$1" in
apps:destroy)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
verify_app_name "$2"
[[ "$2" == "tls" ]] && echo "Unable to destroy tls directory" && exit 1
APP="$2"; IMAGE="dokku/$APP"
[[ "$3" == "force" ]] && DOKKU_APPS_FORCE_DELETE=1
APP="$2"; verify_app_name "$APP"
if [[ -z "$DOKKU_APPS_FORCE_DELETE" ]]; then
dokku_log_warn "WARNING: Potentially Destructive Action"
dokku_log_warn "This command will destroy $APP (including all add-ons)."
@@ -48,8 +47,6 @@ case "$1" in
done
fi
docker images | grep $IMAGE | awk '{print $3}' | xargs docker rmi &> /dev/null &
pluginhook post-delete $APP
;;

View File

@@ -1,4 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"
[[ -n $1 ]] && rm -r "$DOKKU_ROOT/$1" > /dev/null
[[ -n $APP ]] && rm -r "$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 | xargs) &>/dev/null || true

View File

@@ -1,7 +1,10 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$(dirname $0)/../common/functions"
APP="$1"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
verify_app_name "$APP"
APP="$1"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
if [[ -d $CACHE_DIR ]]; then
docker run --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
fi