refactor: remove need for internal dokku calls

Avoid internal dokku calls will avoid potentially expensive subprocesses - in particular, user-auth will be re-invoked, which can be expensive.
This commit is contained in:
Jose Diaz-Gonzalez
2021-01-23 12:32:31 -05:00
parent aad7f67f7c
commit 9137be814c
11 changed files with 55 additions and 14 deletions

View File

@@ -81,9 +81,9 @@ cmd-storage-list() {
declare cmd="storage:list"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
local passed_phases="deploy"
local phase="deploy"
verify_app_name "$APP"
dokku_log_quiet "$APP volume bind-mounts:"
get_bind_mounts "$(get_phase_file_path "$passed_phases")"
plugn trigger storage-list "$APP" "$phase"
}

15
plugins/storage/storage-list Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
source "$PLUGIN_AVAILABLE_PATH/storage/functions"
trigger-storage-storage-list() {
declare desc="storage storage-list trigger"
declare trigger="storage-list"
declare APP="$1" PHASE="$2"
get_bind_mounts "$(fn-get-phase-file-path "$APP" "$PHASE")"
}
trigger-storage-storage-list "$@"