refactor: move command to internal-functions

This commit is contained in:
Jose Diaz-Gonzalez
2017-02-20 18:37:06 -07:00
parent ac8aff1f00
commit a7f32197f3
3 changed files with 14 additions and 12 deletions

View File

@@ -3,16 +3,6 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions"
storage_list_cmd() {
declare desc="List all bound mounts"
local cmd="storage:list"
local passed_phases="deploy"
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2" && local APP="$2"
echo "$APP volume bind-mounts:"
get_bind_mounts "$(get_phase_file_path "$passed_phases")"
}
verify_paths() {
declare desc="verifies storage paths"
echo "$1" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths divided by colon."

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions"
storage_help_content_func() {
declare desc="return storage plugin help content"
@@ -26,3 +29,13 @@ storage_help_cmd() {
help_desc
fi
}
storage_list_cmd() {
declare desc="List all bound mounts"
local cmd="storage:list"
local passed_phases="deploy"
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2" && local APP="$2"
echo "$APP volume bind-mounts:"
get_bind_mounts "$(get_phase_file_path "$passed_phases")"
}

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions"
source "$PLUGIN_AVAILABLE_PATH/storage/internal-functions"
storage_list_cmd "$@"