convert repo plugin to golang

This commit is contained in:
Michael Hobbs committed 2017-03-20 09:15:43 -07:00
1 parent 8d83803763
commit b6dffaabee
44 files changed
+2705 -24

No files matched your search

-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
repo_purge_cache() {
declare desc="deletes the contents of the build cache stored in the repository"
local cmd="repo:purge-cache"
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
local APP="$2";
verify_app_name "$APP"
local IMAGE=$(get_deploying_app_image_name "$APP"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
if [[ -d $CACHE_DIR ]]; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
mkdir -p "$CACHE_DIR" || true
fi
}
repo_purge_cache "$@"