From 1cb586b2e7ebd0b508b738e8139b00b8dd7a0812 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 9 Feb 2020 22:41:39 -0500 Subject: [PATCH] refactor: standardize command naming This standardization makes it somewhat easier to read stacktraces as the command names are all uniform, so it will be slightly easier to scan trace output. --- docs/development/plugin-creation.md | 8 ++++---- plugins/00_dokku-standard/subcommands/cleanup | 4 ++-- plugins/00_dokku-standard/subcommands/deploy | 2 +- plugins/00_dokku-standard/subcommands/report | 4 ++-- plugins/00_dokku-standard/subcommands/run | 4 ++-- plugins/00_dokku-standard/subcommands/urls | 4 ++-- plugins/20_events/subcommands/default | 4 ++-- plugins/20_events/subcommands/list | 4 ++-- plugins/20_events/subcommands/off | 4 ++-- plugins/20_events/subcommands/on | 4 ++-- plugins/apps/commands | 2 +- plugins/apps/internal-functions | 4 ++-- plugins/apps/subcommands/clone | 4 ++-- plugins/apps/subcommands/create | 4 ++-- plugins/apps/subcommands/default | 2 +- plugins/apps/subcommands/destroy | 4 ++-- plugins/apps/subcommands/exists | 4 ++-- plugins/apps/subcommands/list | 2 +- plugins/apps/subcommands/lock | 4 ++-- plugins/apps/subcommands/locked | 4 ++-- plugins/apps/subcommands/rename | 4 ++-- plugins/apps/subcommands/unlock | 4 ++-- plugins/certs/commands | 2 +- plugins/certs/internal-functions | 4 ++-- plugins/certs/subcommands/add | 4 ++-- plugins/certs/subcommands/default | 2 +- plugins/certs/subcommands/generate | 4 ++-- plugins/certs/subcommands/info | 2 +- plugins/certs/subcommands/remove | 4 ++-- plugins/checks/commands | 2 +- plugins/checks/internal-functions | 2 +- plugins/checks/subcommands/default | 4 ++-- plugins/checks/subcommands/disable | 4 ++-- plugins/checks/subcommands/enable | 4 ++-- plugins/checks/subcommands/run | 4 ++-- plugins/checks/subcommands/skip | 4 ++-- plugins/common/functions | 4 ++-- plugins/docker-options/commands | 4 ++-- plugins/docker-options/subcommands/add | 4 ++-- plugins/docker-options/subcommands/default | 4 ++-- plugins/docker-options/subcommands/remove | 4 ++-- plugins/domains/commands | 2 +- plugins/domains/internal-functions | 2 +- plugins/domains/subcommands/add | 4 ++-- plugins/domains/subcommands/add-global | 4 ++-- plugins/domains/subcommands/clear | 4 ++-- plugins/domains/subcommands/clear-global | 4 ++-- plugins/domains/subcommands/default | 4 ++-- plugins/domains/subcommands/disable | 4 ++-- plugins/domains/subcommands/enable | 4 ++-- plugins/domains/subcommands/remove | 4 ++-- plugins/domains/subcommands/remove-global | 4 ++-- plugins/domains/subcommands/set | 4 ++-- plugins/domains/subcommands/set-global | 4 ++-- plugins/domains/subcommands/setup | 4 ++-- plugins/enter/subcommands/default | 4 ++-- plugins/git/commands | 6 +++--- plugins/git/functions | 6 +++--- plugins/git/subcommands/initialize | 4 ++-- plugins/git/subcommands/set | 4 ++-- plugins/logs/subcommands/default | 4 ++-- plugins/nginx-vhosts/commands | 2 +- plugins/nginx-vhosts/internal-functions | 2 +- plugins/nginx-vhosts/subcommands/access-logs | 4 ++-- plugins/nginx-vhosts/subcommands/build-config | 4 ++-- plugins/nginx-vhosts/subcommands/default | 2 +- plugins/nginx-vhosts/subcommands/set | 4 ++-- plugins/nginx-vhosts/subcommands/show-conf | 4 ++-- plugins/nginx-vhosts/subcommands/validate | 4 ++-- plugins/plugin/internal-functions | 2 +- plugins/plugin/subcommands/default | 2 +- plugins/plugin/subcommands/disable | 4 ++-- plugins/plugin/subcommands/enable | 4 ++-- plugins/plugin/subcommands/install | 4 ++-- plugins/plugin/subcommands/install-dependencies | 4 ++-- plugins/plugin/subcommands/list | 2 +- plugins/plugin/subcommands/trigger | 4 ++-- plugins/plugin/subcommands/uninstall | 4 ++-- plugins/plugin/subcommands/update | 4 ++-- plugins/proxy/commands | 2 +- plugins/proxy/internal-functions | 2 +- plugins/proxy/subcommands/default | 4 ++-- plugins/proxy/subcommands/disable | 4 ++-- plugins/proxy/subcommands/enable | 4 ++-- plugins/proxy/subcommands/ports | 4 ++-- plugins/proxy/subcommands/ports-add | 4 ++-- plugins/proxy/subcommands/ports-clear | 4 ++-- plugins/proxy/subcommands/ports-remove | 4 ++-- plugins/proxy/subcommands/ports-set | 4 ++-- plugins/proxy/subcommands/set | 4 ++-- plugins/ps/subcommands/default | 4 ++-- plugins/ps/subcommands/rebuild | 4 ++-- plugins/ps/subcommands/rebuildall | 4 ++-- plugins/ps/subcommands/restart | 4 ++-- plugins/ps/subcommands/restart-policy | 4 ++-- plugins/ps/subcommands/restartall | 4 ++-- plugins/ps/subcommands/restore | 4 ++-- plugins/ps/subcommands/retire | 4 ++-- plugins/ps/subcommands/scale | 4 ++-- plugins/ps/subcommands/set-restart-policy | 4 ++-- plugins/ps/subcommands/start | 4 ++-- plugins/ps/subcommands/startall | 4 ++-- plugins/ps/subcommands/stop | 4 ++-- plugins/ps/subcommands/stopall | 4 ++-- plugins/scheduler-docker-local/subcommands/set | 4 ++-- plugins/shell/subcommands/default | 4 ++-- plugins/ssh-keys/commands | 2 +- plugins/ssh-keys/functions | 7 ------- plugins/ssh-keys/internal-functions | 10 +++++++++- plugins/ssh-keys/subcommands/add | 4 ++-- plugins/ssh-keys/subcommands/default | 2 +- plugins/ssh-keys/subcommands/list | 4 ++-- plugins/ssh-keys/subcommands/remove | 4 ++-- plugins/storage/commands | 2 +- plugins/storage/internal-functions | 4 ++-- plugins/storage/subcommands/default | 2 +- plugins/storage/subcommands/list | 2 +- plugins/storage/subcommands/mount | 4 ++-- plugins/storage/subcommands/unmount | 4 ++-- plugins/tags/subcommands/create | 4 ++-- plugins/tags/subcommands/default | 4 ++-- plugins/tags/subcommands/deploy | 4 ++-- plugins/tags/subcommands/destroy | 4 ++-- plugins/tar/commands | 2 +- plugins/tar/functions | 4 ++-- plugins/tar/internal-functions | 2 +- plugins/tar/subcommands/default | 2 +- plugins/tar/subcommands/from | 2 +- plugins/tar/subcommands/in | 2 +- plugins/trace/commands | 2 +- plugins/trace/internal-functions | 2 +- plugins/trace/subcommands/default | 4 ++-- plugins/trace/subcommands/off | 4 ++-- plugins/trace/subcommands/on | 4 ++-- 134 files changed, 246 insertions(+), 245 deletions(-) diff --git a/docs/development/plugin-creation.md b/docs/development/plugin-creation.md index 162389ac1..77c240dcf 100644 --- a/docs/development/plugin-creation.md +++ b/docs/development/plugin-creation.md @@ -233,7 +233,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -hello_main_cmd() { +cmd-hello-default() { declare desc="prints Hello \$APP" declare cmd="hello" argv=("$@") [[ ${argv[0]} == "$cmd" ]] && shift 1 @@ -250,7 +250,7 @@ hello_main_cmd() { echo "Hello $APP" } -hello_main_cmd "$@" +cmd-hello-default "$@" ``` `hello/subcommands/world` @@ -261,7 +261,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -hello_world_cmd() { +cmd-hello-world() { declare desc="prints Hello world" declare cmd="hello:world" argv=("$@") [[ ${argv[0]} == "$cmd" ]] && shift 1 @@ -269,7 +269,7 @@ hello_world_cmd() { echo "Hello world" } -hello_world_cmd "$@" +cmd-hello-world "$@" ``` `hello/commands` diff --git a/plugins/00_dokku-standard/subcommands/cleanup b/plugins/00_dokku-standard/subcommands/cleanup index 766089a44..42918a2b4 100755 --- a/plugins/00_dokku-standard/subcommands/cleanup +++ b/plugins/00_dokku-standard/subcommands/cleanup @@ -3,7 +3,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -dokku_cleanup_cmd() { +cmd-cleanup() { declare desc="cleans up old deployment cruft" declare cmd="cleanup" [[ "$1" == "$cmd" ]] && shift 1 @@ -16,4 +16,4 @@ dokku_cleanup_cmd() { docker_cleanup "$APP" "true" } -dokku_cleanup_cmd "$@" +cmd-cleanup "$@" diff --git a/plugins/00_dokku-standard/subcommands/deploy b/plugins/00_dokku-standard/subcommands/deploy index 4d5fae244..d49bc9e3b 100755 --- a/plugins/00_dokku-standard/subcommands/deploy +++ b/plugins/00_dokku-standard/subcommands/deploy @@ -4,4 +4,4 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" shift 1 -dokku_deploy_cmd "$@" +cmd-deploy "$@" diff --git a/plugins/00_dokku-standard/subcommands/report b/plugins/00_dokku-standard/subcommands/report index a8751baf3..67a29e175 100755 --- a/plugins/00_dokku-standard/subcommands/report +++ b/plugins/00_dokku-standard/subcommands/report @@ -3,7 +3,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -dokku_report_cmd() { +cmd-report() { declare desc="reports dokku vitals for troubleshooting" local cmd="report" declare APP="$2" @@ -31,4 +31,4 @@ dokku_report_cmd() { fi } -dokku_report_cmd "$@" +cmd-report "$@" diff --git a/plugins/00_dokku-standard/subcommands/run b/plugins/00_dokku-standard/subcommands/run index 22b87748c..e7a82c1df 100755 --- a/plugins/00_dokku-standard/subcommands/run +++ b/plugins/00_dokku-standard/subcommands/run @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" -dokku_run_cmd() { +cmd-run() { declare desc="runs command in container based on app image" declare cmd="run" APP="" shift @@ -40,4 +40,4 @@ dokku_run_cmd() { plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "${#RUN_ENV[@]}" "${RUN_ENV[@]}" "$@" } -dokku_run_cmd "$@" +cmd-run "$@" diff --git a/plugins/00_dokku-standard/subcommands/urls b/plugins/00_dokku-standard/subcommands/urls index eaee51564..8a2be2cbe 100755 --- a/plugins/00_dokku-standard/subcommands/urls +++ b/plugins/00_dokku-standard/subcommands/urls @@ -3,11 +3,11 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -dokku_urls_cmd() { +cmd-urls() { [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$2" get_app_urls "$@" } -dokku_urls_cmd "$@" +cmd-urls "$@" diff --git a/plugins/20_events/subcommands/default b/plugins/20_events/subcommands/default index e29c15aab..93f7e646f 100755 --- a/plugins/20_events/subcommands/default +++ b/plugins/20_events/subcommands/default @@ -3,7 +3,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -events_main_cmd() { +cmd-events-default() { declare desc="shows contents of dokku events log" local cmd="events" if [[ -f $DOKKU_EVENTS_LOGFILE ]]; then @@ -15,4 +15,4 @@ events_main_cmd() { fi } -events_main_cmd "$@" +cmd-events-default "$@" diff --git a/plugins/20_events/subcommands/list b/plugins/20_events/subcommands/list index ddfbe4ea2..2aeceb02e 100755 --- a/plugins/20_events/subcommands/list +++ b/plugins/20_events/subcommands/list @@ -3,7 +3,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -events_list_cmd() { +cmd-events-list() { declare desc="lists enabled events" local cmd="events:list" local PLUGIN_DIR="$(dirname "$0")/.." @@ -21,4 +21,4 @@ events_list_cmd() { fi } -events_list_cmd "$@" +cmd-events-list "$@" diff --git a/plugins/20_events/subcommands/off b/plugins/20_events/subcommands/off index b91273f27..6adf893d0 100755 --- a/plugins/20_events/subcommands/off +++ b/plugins/20_events/subcommands/off @@ -3,11 +3,11 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -events_off_cmd() { +cmd-events-off() { declare desc="disables dokku events logger" local cmd="events:off" echo "Disabling dokku events logger" rm -f "$DOKKU_ROOT/.dokkurc/DOKKU_EVENTS" } -events_off_cmd "$@" +cmd-events-off "$@" diff --git a/plugins/20_events/subcommands/on b/plugins/20_events/subcommands/on index 92d1ec1c6..15738c528 100755 --- a/plugins/20_events/subcommands/on +++ b/plugins/20_events/subcommands/on @@ -3,7 +3,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -events_on_cmd() { +cmd-events-on() { declare desc="enables dokku events logger" local cmd="events:on" echo "Enabling dokku events logger" @@ -11,4 +11,4 @@ events_on_cmd() { echo "export DOKKU_EVENTS=1" >"$DOKKU_ROOT/.dokkurc/DOKKU_EVENTS" } -events_on_cmd "$@" +cmd-events-on "$@" diff --git a/plugins/apps/commands b/plugins/apps/commands index 79b1ab4ae..7bba325ec 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -6,7 +6,7 @@ set -eo pipefail case "$1" in help | apps:help) - apps_help_cmd "$@" + cmd-apps-help "$@" ;; *) diff --git a/plugins/apps/internal-functions b/plugins/apps/internal-functions index 5f92c2439..3234cf0d1 100755 --- a/plugins/apps/internal-functions +++ b/plugins/apps/internal-functions @@ -95,7 +95,7 @@ apps_help_content_func() { help_content } -apps_help_cmd() { +cmd-apps-help() { if [[ $1 == "apps:help" ]]; then echo -e 'Usage: dokku apps[:COMMAND]' echo '' @@ -119,7 +119,7 @@ help_desc fi } -apps_list_cmd() { +cmd-apps-list() { declare desc="lists all apps" local cmd="apps" local app diff --git a/plugins/apps/subcommands/clone b/plugins/apps/subcommands/clone index 8ab7ec1a3..21b405d11 100755 --- a/plugins/apps/subcommands/clone +++ b/plugins/apps/subcommands/clone @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" -apps_clone_cmd() { +cmd-apps-clone() { declare desc="clones an app" declare cmd="apps:clone" argv=("$@") [[ ${argv[0]} == "$cmd" ]] && shift 1 @@ -56,4 +56,4 @@ apps_clone_cmd() { dokku_log_info1_quiet "Cloning $OLD_APP to $NEW_APP... done" } -apps_clone_cmd "$@" +cmd-apps-clone "$@" diff --git a/plugins/apps/subcommands/create b/plugins/apps/subcommands/create index 83d74d2d9..ca0b1783d 100755 --- a/plugins/apps/subcommands/create +++ b/plugins/apps/subcommands/create @@ -3,10 +3,10 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/apps/functions" -apps_create_cmd() { +cmd-apps-create() { declare desc="creates app via command line" local cmd="apps:create" apps_create "$2" } -apps_create_cmd "$@" +cmd-apps-create "$@" diff --git a/plugins/apps/subcommands/default b/plugins/apps/subcommands/default index 0a0014418..93dee2425 100755 --- a/plugins/apps/subcommands/default +++ b/plugins/apps/subcommands/default @@ -4,4 +4,4 @@ set -eo pipefail source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" dokku_log_warn "Deprecated: Please use apps:list" -apps_list_cmd "$@" +cmd-apps-list "$@" diff --git a/plugins/apps/subcommands/destroy b/plugins/apps/subcommands/destroy index dca12a426..1cdd0c97c 100755 --- a/plugins/apps/subcommands/destroy +++ b/plugins/apps/subcommands/destroy @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions" -apps_destroy_cmd() { +cmd-apps-destroy() { declare desc="destroys an app" local cmd="apps:destroy" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -14,4 +14,4 @@ apps_destroy_cmd() { apps_destroy "$APP" } -apps_destroy_cmd "$@" +cmd-apps-destroy "$@" diff --git a/plugins/apps/subcommands/exists b/plugins/apps/subcommands/exists index b5cbb4108..bb3c6b9fc 100755 --- a/plugins/apps/subcommands/exists +++ b/plugins/apps/subcommands/exists @@ -3,7 +3,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/apps/functions" -apps_exists_cmd() { +cmd-apps-exist() { declare desc="checks if an app exists" local cmd="apps:exists" [[ "$1" == "$cmd" ]] && shift 1 @@ -15,4 +15,4 @@ apps_exists_cmd() { dokku_log_info1 "App exists" } -apps_exists_cmd "$@" +cmd-apps-exist "$@" diff --git a/plugins/apps/subcommands/list b/plugins/apps/subcommands/list index 3da1d8e7b..b7832c4b7 100755 --- a/plugins/apps/subcommands/list +++ b/plugins/apps/subcommands/list @@ -3,4 +3,4 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" -apps_list_cmd "$@" +cmd-apps-list "$@" diff --git a/plugins/apps/subcommands/lock b/plugins/apps/subcommands/lock index bcbd1ce41..0905c8952 100755 --- a/plugins/apps/subcommands/lock +++ b/plugins/apps/subcommands/lock @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" -apps_lock_cmd() { +cmd-apps-lock() { declare desc="locks an app for deployment" declare cmd="apps:lock" [[ "$1" == "$cmd" ]] && shift 1 @@ -16,4 +16,4 @@ apps_lock_cmd() { dokku_log_info1 "Deploy lock created" } -apps_lock_cmd "$@" +cmd-apps-lock "$@" diff --git a/plugins/apps/subcommands/locked b/plugins/apps/subcommands/locked index ce27a2845..5d1391e13 100755 --- a/plugins/apps/subcommands/locked +++ b/plugins/apps/subcommands/locked @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" -apps_locked_cmd() { +cmd-apps-locked() { declare desc="checks if an app is locked for deployment" declare cmd="apps:locked" [[ "$1" == "$cmd" ]] && shift 1 @@ -19,4 +19,4 @@ apps_locked_cmd() { dokku_log_quiet "Deploy lock exists" } -apps_locked_cmd "$@" +cmd-apps-locked "$@" diff --git a/plugins/apps/subcommands/rename b/plugins/apps/subcommands/rename index ed94cb1dc..1cd5a2f28 100755 --- a/plugins/apps/subcommands/rename +++ b/plugins/apps/subcommands/rename @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" -apps_rename_cmd() { +cmd-apps-rename() { declare desc="renames an app" local cmd="apps:rename" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -34,4 +34,4 @@ apps_rename_cmd() { echo "Renaming $OLD_APP to $NEW_APP... done" } -apps_rename_cmd "$@" +cmd-apps-rename "$@" diff --git a/plugins/apps/subcommands/unlock b/plugins/apps/subcommands/unlock index fa3f95e06..eba5a1fcf 100755 --- a/plugins/apps/subcommands/unlock +++ b/plugins/apps/subcommands/unlock @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions" -apps_unlock_cmd() { +cmd-apps-unlock() { declare desc="unlocks an app for deployment" declare cmd="apps:unlock" [[ "$1" == "$cmd" ]] && shift 1 @@ -21,4 +21,4 @@ apps_unlock_cmd() { dokku_log_info1 "Deploy lock removed" } -apps_unlock_cmd "$@" +cmd-apps-unlock "$@" diff --git a/plugins/certs/commands b/plugins/certs/commands index 17fa444fc..45ba33e1a 100755 --- a/plugins/certs/commands +++ b/plugins/certs/commands @@ -6,7 +6,7 @@ set -eo pipefail case "$1" in help | certs:help) - certs_help_cmd "$@" + cmd-certs-help "$@" ;; *) diff --git a/plugins/certs/internal-functions b/plugins/certs/internal-functions index b6ae228e0..a3aed6a95 100755 --- a/plugins/certs/internal-functions +++ b/plugins/certs/internal-functions @@ -87,7 +87,7 @@ certs_help_content_func() { help_content } -certs_help_cmd() { +cmd-certs-help() { if [[ $1 == "certs:help" ]]; then echo -e 'Usage: dokku certs[:COMMAND]' echo '' @@ -104,7 +104,7 @@ help_desc fi } -certs_info_cmd() { +cmd-certs-info() { # This is here because it's used in both the info and the default declare desc="prints SSL certificate info for app" local cmd="certs:info" diff --git a/plugins/certs/subcommands/add b/plugins/certs/subcommands/add index fcf8425c3..5d0a084e4 100755 --- a/plugins/certs/subcommands/add +++ b/plugins/certs/subcommands/add @@ -28,7 +28,7 @@ is_file_import() { return 1 } -certs_set() { +cmd-certs-set() { declare desc="imports an SSL cert/key combo either on STDIN via a tarball or from specified cert/key filenames" local cmd="$1" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -79,4 +79,4 @@ certs_set() { plugn trigger post-domains-update "$APP" } -certs_set "$@" +cmd-certs-set "$@" diff --git a/plugins/certs/subcommands/default b/plugins/certs/subcommands/default index 44aa722dd..5939039d9 100755 --- a/plugins/certs/subcommands/default +++ b/plugins/certs/subcommands/default @@ -4,4 +4,4 @@ set -eo pipefail source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions" dokku_log_warn "Deprecated: Please use certs:report" -certs_info_cmd "$@" +cmd-certs-info "$@" diff --git a/plugins/certs/subcommands/generate b/plugins/certs/subcommands/generate index 4d691bce3..bb6ee7099 100755 --- a/plugins/certs/subcommands/generate +++ b/plugins/certs/subcommands/generate @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -certs_generate_cmd() { +cmd-certs-generate() { declare desc="generates a self-signed SSL certificate/key combo" declare APP="$2" DOMAIN="$3" local cmd="certs:generate" @@ -37,4 +37,4 @@ certs_generate_cmd() { fi } -certs_generate_cmd "$@" +cmd-certs-generate "$@" diff --git a/plugins/certs/subcommands/info b/plugins/certs/subcommands/info index 44aa722dd..5939039d9 100755 --- a/plugins/certs/subcommands/info +++ b/plugins/certs/subcommands/info @@ -4,4 +4,4 @@ set -eo pipefail source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions" dokku_log_warn "Deprecated: Please use certs:report" -certs_info_cmd "$@" +cmd-certs-info "$@" diff --git a/plugins/certs/subcommands/remove b/plugins/certs/subcommands/remove index aeb2235ec..ac6b02bf2 100755 --- a/plugins/certs/subcommands/remove +++ b/plugins/certs/subcommands/remove @@ -3,7 +3,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -certs_remove_cmd() { +cmd-certs-remove() { declare desc="removes SSL cert/key from specified app" local cmd="certs:remove" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -21,4 +21,4 @@ certs_remove_cmd() { fi } -certs_remove_cmd "$@" +cmd-certs-remove "$@" diff --git a/plugins/checks/commands b/plugins/checks/commands index 850cb9e97..8889968d3 100755 --- a/plugins/checks/commands +++ b/plugins/checks/commands @@ -6,7 +6,7 @@ set -eo pipefail case "$1" in help | checks:help) - checks_help_cmd "$@" + cmd-checks-help "$@" ;; *) diff --git a/plugins/checks/internal-functions b/plugins/checks/internal-functions index 55ea99c69..58ff9a150 100755 --- a/plugins/checks/internal-functions +++ b/plugins/checks/internal-functions @@ -77,7 +77,7 @@ checks_help_content_func() { help_content } -checks_help_cmd() { +cmd-checks-help() { if [[ $1 == "checks:help" ]]; then echo -e 'Usage: dokku checks[:COMMAND]' echo '' diff --git a/plugins/checks/subcommands/default b/plugins/checks/subcommands/default index 5f99e8f1b..8c4b0f876 100755 --- a/plugins/checks/subcommands/default +++ b/plugins/checks/subcommands/default @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" -checks_main_cmd() { +cmd-checks-default() { declare desc="displays app zero-downtime checks status" local cmd="checks" [[ "$1" == "$cmd" ]] && shift 1 @@ -26,4 +26,4 @@ checks_main_cmd() { done } -checks_main_cmd "$@" +cmd-checks-default "$@" diff --git a/plugins/checks/subcommands/disable b/plugins/checks/subcommands/disable index 0ae59bba7..85b7aae58 100755 --- a/plugins/checks/subcommands/disable +++ b/plugins/checks/subcommands/disable @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" -checks_disable_cmd() { +cmd-checks-disable() { declare desc="disable zero-downtime checks for app/proctypes" local cmd="checks:disable" [[ "$1" == "$cmd" ]] && shift 1 @@ -43,4 +43,4 @@ checks_disable_cmd() { fi } -checks_disable_cmd "$@" +cmd-checks-disable "$@" diff --git a/plugins/checks/subcommands/enable b/plugins/checks/subcommands/enable index 59e2974b9..3db35d07e 100755 --- a/plugins/checks/subcommands/enable +++ b/plugins/checks/subcommands/enable @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" -checks_enable_cmd() { +cmd-checks-enable() { declare desc="enable zero-downtime checks for app/proctypes" local cmd="checks:enable" [[ "$1" == "$cmd" ]] && shift 1 @@ -42,4 +42,4 @@ checks_enable_cmd() { fi } -checks_enable_cmd "$@" +cmd-checks-enable "$@" diff --git a/plugins/checks/subcommands/run b/plugins/checks/subcommands/run index 892268cbf..fb50a8d34 100755 --- a/plugins/checks/subcommands/run +++ b/plugins/checks/subcommands/run @@ -67,7 +67,7 @@ check_process() { plugn trigger check-deploy "$APP" "$CONTAINER_ID" "$PROC_TYPE" "$PORT" "$IP" } -checks_run_cmd() { +cmd-checks-run() { declare desc="run zero-downtime checks for app/proctypes" local cmd="checks:run" [[ "$1" == "$cmd" ]] && shift 1 @@ -94,4 +94,4 @@ checks_run_cmd() { fi } -checks_run_cmd "$@" +cmd-checks-run "$@" diff --git a/plugins/checks/subcommands/skip b/plugins/checks/subcommands/skip index 169307c8c..8c3e57137 100755 --- a/plugins/checks/subcommands/skip +++ b/plugins/checks/subcommands/skip @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" -checks_skip_cmd() { +cmd-checks-skip() { declare desc="skip zero-downtime checks for app/proctypes" local cmd="checks:skip" [[ "$1" == "$cmd" ]] && shift 1 @@ -43,4 +43,4 @@ checks_skip_cmd() { fi } -checks_skip_cmd "$@" +cmd-checks-skip "$@" diff --git a/plugins/common/functions b/plugins/common/functions index 592cc2e9c..ddb074bde 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -571,7 +571,7 @@ dokku_release() { plugn trigger builder-release "$IMAGE_SOURCE_TYPE" "$APP" "$IMAGE_TAG" } -dokku_deploy_cmd() { +cmd-deploy() { declare desc="deploy phase" declare APP="$1" IMAGE_TAG="$2" source "$PLUGIN_AVAILABLE_PATH/config/functions" @@ -613,7 +613,7 @@ release_and_deploy() { if [[ "$DOKKU_SKIP_DEPLOY" != "true" ]]; then dokku_log_info1 "Deploying $APP ($IMAGE)..." - dokku_deploy_cmd "$APP" "$IMAGE_TAG" + cmd-deploy "$APP" "$IMAGE_TAG" dokku_log_info2 "Application deployed:" get_app_urls urls "$APP" | sed "s/^/ /" else diff --git a/plugins/docker-options/commands b/plugins/docker-options/commands index b29fbd6ef..fdcf24568 100755 --- a/plugins/docker-options/commands +++ b/plugins/docker-options/commands @@ -14,7 +14,7 @@ docker_options_help_content_func() { help_content } -docker_options_help_cmd() { +cmd-docker-options-help() { if [[ $1 == "docker-options:help" ]]; then echo -e 'Usage: dokku docker-options[:COMMAND]' echo '' @@ -33,7 +33,7 @@ help_desc case "$1" in help | docker-options:help) - docker_options_help_cmd "$@" + cmd-docker-options-help "$@" ;; *) diff --git a/plugins/docker-options/subcommands/add b/plugins/docker-options/subcommands/add index 72d64129c..799c9831e 100755 --- a/plugins/docker-options/subcommands/add +++ b/plugins/docker-options/subcommands/add @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/docker-options/functions" -docker_options_add_cmd() { +cmd-docker-options-add() { declare desc="Add a docker option to application" local cmd="docker-options:add" @@ -16,4 +16,4 @@ docker_options_add_cmd() { add_passed_docker_option passed_phases[@] "${passed_docker_option[@]}" } -docker_options_add_cmd "$@" +cmd-docker-options-add "$@" diff --git a/plugins/docker-options/subcommands/default b/plugins/docker-options/subcommands/default index 8032e9a84..9ffe4fe01 100755 --- a/plugins/docker-options/subcommands/default +++ b/plugins/docker-options/subcommands/default @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/docker-options/functions" -docker_options_main_cmd() { +cmd-docker-options-default() { declare desc="Display applications docker options" local cmd="docker-options" dokku_log_warn "Deprecated: Please use docker-options:report" @@ -18,4 +18,4 @@ docker_options_main_cmd() { fi } -docker_options_main_cmd "$@" +cmd-docker-options-default "$@" diff --git a/plugins/docker-options/subcommands/remove b/plugins/docker-options/subcommands/remove index d63be3822..a57a8080d 100755 --- a/plugins/docker-options/subcommands/remove +++ b/plugins/docker-options/subcommands/remove @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/docker-options/functions" -docker_options_remove_cmd() { +cmd-docker-options-remove() { declare desc="Remove a docker option from application" local cmd="docker-options:remove" @@ -16,4 +16,4 @@ docker_options_remove_cmd() { remove_passed_docker_option passed_phases[@] "${passed_docker_option[@]}" } -docker_options_remove_cmd "$@" +cmd-docker-options-remove "$@" diff --git a/plugins/domains/commands b/plugins/domains/commands index 328664b40..695b00b66 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -6,7 +6,7 @@ set -eo pipefail case "$1" in help | domains:help) - domains_help_cmd "$@" + cmd-domains-help "$@" ;; *) diff --git a/plugins/domains/internal-functions b/plugins/domains/internal-functions index 8da721b64..89af4f890 100755 --- a/plugins/domains/internal-functions +++ b/plugins/domains/internal-functions @@ -102,7 +102,7 @@ domains_help_content_func() { help_content } -domains_help_cmd() { +cmd-domains-help() { if [[ $1 == "domains:help" ]]; then echo -e 'Usage: dokku domains[:COMMAND]' echo '' diff --git a/plugins/domains/subcommands/add b/plugins/domains/subcommands/add index 382976691..e8e8cd5b9 100755 --- a/plugins/domains/subcommands/add +++ b/plugins/domains/subcommands/add @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_add_cmd() { +cmd-domains-add() { declare desc="adds domains to app via command line" local cmd="domains:add" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -14,4 +14,4 @@ domains_add_cmd() { domains_add "$@" } -domains_add_cmd "$@" +cmd-domains-add "$@" diff --git a/plugins/domains/subcommands/add-global b/plugins/domains/subcommands/add-global index c58eed710..4ccf1b825 100755 --- a/plugins/domains/subcommands/add-global +++ b/plugins/domains/subcommands/add-global @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_add_global_cmd() { +cmd-domains-add-global() { declare desc="add global domain names via command line" local cmd="domains:add-global" [[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 [ ...]" @@ -13,4 +13,4 @@ domains_add_global_cmd() { domains_add_global "$@" } -domains_add_global_cmd "$@" +cmd-domains-add-global "$@" diff --git a/plugins/domains/subcommands/clear b/plugins/domains/subcommands/clear index 1ea9a4b19..759c132a2 100755 --- a/plugins/domains/subcommands/clear +++ b/plugins/domains/subcommands/clear @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_clear_cmd() { +cmd-domains-clear() { declare desc="clear all app domains" local cmd="domains:clear" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -18,4 +18,4 @@ domains_clear_cmd() { dokku_log_info1 "Cleared domains in $APP" } -domains_clear_cmd "$@" +cmd-domains-clear "$@" diff --git a/plugins/domains/subcommands/clear-global b/plugins/domains/subcommands/clear-global index 42ce3ee30..9024a6430 100755 --- a/plugins/domains/subcommands/clear-global +++ b/plugins/domains/subcommands/clear-global @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_clear_global_cmd() { +cmd-domains-clear-global() { declare desc="clear global domain names via command line" local cmd="domains:clear-global" shift 1 @@ -13,4 +13,4 @@ domains_clear_global_cmd() { domains_clear_global "$@" } -domains_clear_global_cmd "$@" +cmd-domains-clear-global "$@" diff --git a/plugins/domains/subcommands/default b/plugins/domains/subcommands/default index 6930e6b52..6b9650fa1 100755 --- a/plugins/domains/subcommands/default +++ b/plugins/domains/subcommands/default @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_main_cmd() { +cmd-domains-default() { declare desc="print app domains" local cmd="domains" local APP="$2" @@ -30,4 +30,4 @@ domains_main_cmd() { fi } -domains_main_cmd "$@" +cmd-domains-default "$@" diff --git a/plugins/domains/subcommands/disable b/plugins/domains/subcommands/disable index 1a5e469e6..224176e30 100755 --- a/plugins/domains/subcommands/disable +++ b/plugins/domains/subcommands/disable @@ -4,11 +4,11 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_disable_cmd() { +cmd-domains-disable() { declare desc="disable domains/VHOST support via command line" local cmd="domains:disable" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" domains_disable "$2" } -domains_disable_cmd "$@" +cmd-domains-disable "$@" diff --git a/plugins/domains/subcommands/enable b/plugins/domains/subcommands/enable index 8253f6a64..5cb4d10da 100755 --- a/plugins/domains/subcommands/enable +++ b/plugins/domains/subcommands/enable @@ -4,11 +4,11 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_enable_cmd() { +cmd-domains-enable() { declare desc="enable domains/VHOST support via command line" local cmd="domains:enable" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" domains_enable "$2" } -domains_enable_cmd "$@" +cmd-domains-enable "$@" diff --git a/plugins/domains/subcommands/remove b/plugins/domains/subcommands/remove index 2d6127cb9..0eaf71cf1 100755 --- a/plugins/domains/subcommands/remove +++ b/plugins/domains/subcommands/remove @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_remove_cmd() { +cmd-domains-remove() { declare desc="removes domains from app via command line" local cmd="domains:remove" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -14,4 +14,4 @@ domains_remove_cmd() { domains_remove "$@" } -domains_remove_cmd "$@" +cmd-domains-remove "$@" diff --git a/plugins/domains/subcommands/remove-global b/plugins/domains/subcommands/remove-global index b9bba0d0f..574184392 100755 --- a/plugins/domains/subcommands/remove-global +++ b/plugins/domains/subcommands/remove-global @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_remove_global_cmd() { +cmd-domains-remove-global() { declare desc="remove global domain names via command line" local cmd="domains:remove-global" [[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 [ ...]" @@ -13,4 +13,4 @@ domains_remove_global_cmd() { domains_remove_global "$@" } -domains_remove_global_cmd "$@" +cmd-domains-remove-global "$@" diff --git a/plugins/domains/subcommands/set b/plugins/domains/subcommands/set index c61dd4c94..2b8ace952 100755 --- a/plugins/domains/subcommands/set +++ b/plugins/domains/subcommands/set @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_set_cmd() { +cmd-domains-set() { declare desc="set domains for app via command line" local cmd="domains:set" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" @@ -14,4 +14,4 @@ domains_set_cmd() { domains_set "$@" } -domains_set_cmd "$@" +cmd-domains-set "$@" diff --git a/plugins/domains/subcommands/set-global b/plugins/domains/subcommands/set-global index 94ea71e72..88f9a5c99 100755 --- a/plugins/domains/subcommands/set-global +++ b/plugins/domains/subcommands/set-global @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_set_global_cmd() { +cmd-domains-set-global() { declare desc="set global domain names via command line" local cmd="domains:set-global" [[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 [ ...]" @@ -13,4 +13,4 @@ domains_set_global_cmd() { domains_set_global "$@" } -domains_set_global_cmd "$@" +cmd-domains-set-global "$@" diff --git a/plugins/domains/subcommands/setup b/plugins/domains/subcommands/setup index b51169582..57be41235 100755 --- a/plugins/domains/subcommands/setup +++ b/plugins/domains/subcommands/setup @@ -4,11 +4,11 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" -domains_setup_cmd() { +cmd-domains-setup() { declare desc="setup domains to default state via command line" local cmd="domains:setup" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" domains_setup "$2" } -domains_setup_cmd "$@" +cmd-domains-setup "$@" diff --git a/plugins/enter/subcommands/default b/plugins/enter/subcommands/default index 10b7a2402..397457197 100755 --- a/plugins/enter/subcommands/default +++ b/plugins/enter/subcommands/default @@ -4,7 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" -enter_default_cmd() { +cmd-enter-default() { declare desc="enters running app container of specified proc type" local cmd="enter" local APP="$2" @@ -63,4 +63,4 @@ enter_default_cmd() { "$DOCKER_BIN" container exec $DOKKU_RUN_OPTS $ID $EXEC_CMD "${@:-$DOKKU_APP_SHELL}" } -enter_default_cmd "$@" +cmd-enter-default "$@" diff --git a/plugins/git/commands b/plugins/git/commands index 654cbcc98..365d6f65a 100755 --- a/plugins/git/commands +++ b/plugins/git/commands @@ -6,15 +6,15 @@ source "$PLUGIN_AVAILABLE_PATH/git/internal-functions" case "$1" in git-hook) - git_hook_cmd "$@" + cmd-git-hook "$@" ;; git-upload-pack) - git_upload_pack_cmd "$@" + cmd-git-upload-pack "$@" ;; git-*) - git_glob_cmd "$@" + cmd-git-glob "$@" ;; help | git:help) diff --git a/plugins/git/functions b/plugins/git/functions index db4ab4837..123b0e6a9 100755 --- a/plugins/git/functions +++ b/plugins/git/functions @@ -123,7 +123,7 @@ git_deploy_branch() { fi } -git_hook_cmd() { +cmd-git-hook() { declare desc="kick off receive-app trigger from git prereceive hook" local cmd="git-hook" local APP="$2" @@ -195,7 +195,7 @@ git_receive_app() { fi } -git_upload_pack_cmd() { +cmd-git-upload-pack() { declare desc="executes git-upload-pack" declare cmd="git-upload-pack" declare APP="$2" @@ -208,7 +208,7 @@ git_upload_pack_cmd() { plugn trigger git-post-pull "$APP" } -git_glob_cmd() { +cmd-git-glob() { declare desc="catch-all for any other git-* commands" local cmd="git-*" local APP="$(echo "$2" | perl -pe 's/(?"$DOKKU_ROOT/.dokkurc/DOKKU_TRACE" } -trace_on_cmd "$@" +cmd-trace-on "$@"