From 987c5cfb9c7c3e3effed5e6f5be60f3bd5ad885d Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Tue, 8 Mar 2016 15:30:34 -0500 Subject: [PATCH] use declare for description variable --- docs/development/plugin-creation.md | 4 +- dokku | 2 +- .../00_dokku-standard/exec-app-json-scripts | 6 +- plugins/00_dokku-standard/subcommands/build | 2 +- plugins/00_dokku-standard/subcommands/cleanup | 2 +- plugins/00_dokku-standard/subcommands/deploy | 4 +- plugins/00_dokku-standard/subcommands/ls | 2 +- plugins/00_dokku-standard/subcommands/receive | 2 +- plugins/00_dokku-standard/subcommands/release | 2 +- plugins/00_dokku-standard/subcommands/report | 2 +- plugins/00_dokku-standard/subcommands/run | 2 +- plugins/00_dokku-standard/subcommands/trace | 2 +- plugins/00_dokku-standard/subcommands/version | 2 +- plugins/20_events/subcommands/default | 2 +- plugins/20_events/subcommands/list | 2 +- plugins/20_events/subcommands/off | 2 +- plugins/20_events/subcommands/on | 2 +- plugins/apps/functions | 2 +- plugins/apps/post-delete | 2 +- plugins/apps/pre-delete | 2 +- plugins/apps/subcommands/create | 2 +- plugins/apps/subcommands/default | 2 +- plugins/apps/subcommands/destroy | 2 +- plugins/apps/subcommands/rename | 2 +- plugins/build-env/pre-build-buildpack | 2 +- plugins/certs/functions | 4 +- plugins/certs/subcommands/add | 6 +- plugins/certs/subcommands/generate | 2 +- plugins/certs/subcommands/info | 2 +- plugins/certs/subcommands/remove | 2 +- plugins/checks/check-deploy | 4 +- plugins/checks/functions | 2 +- plugins/checks/install | 2 +- plugins/checks/subcommands/default | 2 +- plugins/checks/subcommands/disable | 2 +- plugins/checks/subcommands/enable | 2 +- plugins/common/functions | 110 +++++++++--------- plugins/config/docker-args-deploy | 2 +- plugins/config/functions | 20 ++-- plugins/config/subcommands/default | 2 +- plugins/config/subcommands/get | 2 +- plugins/config/subcommands/set | 2 +- plugins/config/subcommands/unset | 2 +- plugins/docker-options/docker-args-deploy | 2 +- plugins/docker-options/functions | 16 +-- plugins/docker-options/subcommands/add | 2 +- plugins/docker-options/subcommands/default | 2 +- plugins/docker-options/subcommands/remove | 2 +- plugins/domains/functions | 16 +-- plugins/domains/subcommands/add | 2 +- plugins/domains/subcommands/clear | 2 +- plugins/domains/subcommands/default | 2 +- plugins/domains/subcommands/disable | 2 +- plugins/domains/subcommands/enable | 2 +- plugins/domains/subcommands/remove | 2 +- plugins/domains/subcommands/set-global | 2 +- plugins/domains/subcommands/setup | 2 +- plugins/enter/subcommands/default | 2 +- plugins/git/commands | 12 +- plugins/git/receive-app | 2 +- plugins/logs/commands | 2 +- plugins/logs/subcommands/default | 2 +- plugins/named-containers/post-deploy | 2 +- plugins/nginx-vhosts/functions | 14 +-- plugins/nginx-vhosts/post-deploy | 2 +- plugins/nginx-vhosts/post-domains-update | 2 +- plugins/nginx-vhosts/proxy-disable | 2 +- plugins/nginx-vhosts/proxy-enable | 2 +- plugins/nginx-vhosts/subcommands/access-logs | 2 +- plugins/nginx-vhosts/subcommands/build-config | 2 +- plugins/plugin/functions | 14 +-- plugins/plugin/subcommands/default | 2 +- plugins/plugin/subcommands/disable | 2 +- plugins/plugin/subcommands/enable | 2 +- plugins/plugin/subcommands/install | 2 +- .../plugin/subcommands/install-dependencies | 2 +- plugins/plugin/subcommands/uninstall | 2 +- plugins/plugin/subcommands/update | 2 +- plugins/proxy/functions | 4 +- plugins/proxy/subcommands/default | 2 +- plugins/proxy/subcommands/disable | 2 +- plugins/proxy/subcommands/enable | 2 +- plugins/proxy/subcommands/set | 2 +- plugins/ps/functions | 20 ++-- plugins/ps/post-deploy | 2 +- plugins/ps/post-stop | 2 +- plugins/ps/pre-deploy | 2 +- plugins/ps/subcommands/default | 2 +- plugins/ps/subcommands/rebuild | 2 +- plugins/ps/subcommands/rebuildall | 2 +- plugins/ps/subcommands/restart | 2 +- plugins/ps/subcommands/restartall | 2 +- plugins/ps/subcommands/restore | 2 +- plugins/ps/subcommands/scale | 2 +- plugins/ps/subcommands/start | 2 +- plugins/ps/subcommands/stop | 2 +- plugins/shell/subcommands/default | 2 +- plugins/storage/functions | 6 +- plugins/storage/subcommands/list | 2 +- plugins/storage/subcommands/mount | 2 +- plugins/storage/subcommands/unmount | 2 +- plugins/tags/functions | 2 +- plugins/tags/subcommands/create | 2 +- plugins/tags/subcommands/default | 2 +- plugins/tags/subcommands/deploy | 2 +- plugins/tags/subcommands/destroy | 2 +- plugins/tar/receive-app | 2 +- plugins/tar/subcommands/build | 2 +- plugins/tar/subcommands/build-locked | 2 +- plugins/tar/subcommands/from | 2 +- plugins/tar/subcommands/in | 2 +- 111 files changed, 225 insertions(+), 225 deletions(-) diff --git a/docs/development/plugin-creation.md b/docs/development/plugin-creation.md index f4fd5577d..e3d2e68e3 100644 --- a/docs/development/plugin-creation.md +++ b/docs/development/plugin-creation.md @@ -20,7 +20,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" hello_main_cmd() { - local desc="prints Hello \$APP" + declare desc="prints Hello \$APP" local cmd="hello" # Support --app/$DOKKU_APP_NAME flag # Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@"" @@ -48,7 +48,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" hello_world_cmd() { - local desc="prints Hello World" + declare desc="prints Hello World" local cmd="hello:world" # Support --app/$DOKKU_APP_NAME flag # Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@"" diff --git a/dokku b/dokku index fe669e9dc..2c7abe1ee 100755 --- a/dokku +++ b/dokku @@ -87,7 +87,7 @@ if ! dokku_auth "$@" ; then fi execute_dokku_cmd() { - local desc="executes dokku sub-commands" + declare desc="executes dokku sub-commands" local PLUGIN_NAME="$1" local PLUGIN_CMD=$PLUGIN_NAME local implemented=0; local script diff --git a/plugins/00_dokku-standard/exec-app-json-scripts b/plugins/00_dokku-standard/exec-app-json-scripts index 88d5a39cb..949625921 100755 --- a/plugins/00_dokku-standard/exec-app-json-scripts +++ b/plugins/00_dokku-standard/exec-app-json-scripts @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" get_phase_script() { - local desc="extracts app.json from app image and returns the appropriate json key/value" + declare desc="extracts app.json from app image and returns the appropriate json key/value" local IMAGE="$1"; local PHASE_SCRIPT_KEY="$2" local TMP_WORK_DIR=$(mktemp -d -t "dokku_get_phase_script.XXXX") local APP_JSON_FILE="$TMP_WORK_DIR/app.json" @@ -21,7 +21,7 @@ get_phase_script() { } execute_script() { - local desc="executes appropriate phase script key from app.json" + declare desc="executes appropriate phase script key from app.json" local APP="$1"; local IMAGE="$2"; local PHASE_SCRIPT_KEY="$3" local SCRIPT_CMD=$(get_phase_script "$IMAGE" "$PHASE_SCRIPT_KEY") if [[ -n "$SCRIPT_CMD" ]];then @@ -46,7 +46,7 @@ execute_script() { } exec_app_json_scripts() { - local desc="core app.json scripts execution" + declare desc="core app.json scripts execution" local trigger="$0 app_json_scripts" local APP="$1" diff --git a/plugins/00_dokku-standard/subcommands/build b/plugins/00_dokku-standard/subcommands/build index c0a146be1..1bbdc0fcc 100755 --- a/plugins/00_dokku-standard/subcommands/build +++ b/plugins/00_dokku-standard/subcommands/build @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" dokku_build_cmd() { - local desc="build phase" + declare desc="build phase" local cmd="build" local APP="$2"; local IMAGE_SOURCE_TYPE="$3"; local TMP_WORK_DIR="$4"; local IMAGE=$(get_app_image_name "$APP") verify_app_name "$APP" diff --git a/plugins/00_dokku-standard/subcommands/cleanup b/plugins/00_dokku-standard/subcommands/cleanup index db79caac9..69aa0503f 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(){ - local desc="cleans up old deployment cruft" + declare desc="cleans up old deployment cruft" local cmd="cleanup" docker_cleanup diff --git a/plugins/00_dokku-standard/subcommands/deploy b/plugins/00_dokku-standard/subcommands/deploy index 5c8349073..77a2929ea 100755 --- a/plugins/00_dokku-standard/subcommands/deploy +++ b/plugins/00_dokku-standard/subcommands/deploy @@ -6,7 +6,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions" dokku_deploy_cmd() { - local desc="deploy phase" + declare desc="deploy phase" local cmd="deploy" [[ -z $2 ]] && dokku_log_fail "Please specify an app to deploy" local APP="$2"; local IMAGE_TAG="$3"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") @@ -85,7 +85,7 @@ dokku_deploy_cmd() { # if we can't post-deploy successfully, kill new container kill_new() { - local desc="wrapper function to kill newly started app container" + declare desc="wrapper function to kill newly started app container" local id="$1" docker inspect "$id" &> /dev/null && docker stop "$id" > /dev/null && docker kill "$id" &> /dev/null trap - INT TERM EXIT diff --git a/plugins/00_dokku-standard/subcommands/ls b/plugins/00_dokku-standard/subcommands/ls index 23579ae44..b5809c148 100755 --- a/plugins/00_dokku-standard/subcommands/ls +++ b/plugins/00_dokku-standard/subcommands/ls @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" dokku_ls_cmd() { - local desc="lists installed apps with status" + declare desc="lists installed apps with status" local cmd="ls" local installed_apps=$(dokku_apps) local dokku_app diff --git a/plugins/00_dokku-standard/subcommands/receive b/plugins/00_dokku-standard/subcommands/receive index 93611f6a6..3ba53c7de 100755 --- a/plugins/00_dokku-standard/subcommands/receive +++ b/plugins/00_dokku-standard/subcommands/receive @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" dokku_receive_cmd() { - local desc="receives an app kicks off deploy process" + declare desc="receives an app kicks off deploy process" local cmd="receive" local APP="$2"; local IMAGE=$(get_app_image_name "$APP"); local IMAGE_SOURCE_TYPE="$3"; local TMP_WORK_DIR="$4" if [[ -z "$DOKKU_SKIP_CLEANUP" ]]; then diff --git a/plugins/00_dokku-standard/subcommands/release b/plugins/00_dokku-standard/subcommands/release index 0afabfb2e..7dc148014 100755 --- a/plugins/00_dokku-standard/subcommands/release +++ b/plugins/00_dokku-standard/subcommands/release @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" dokku_release_cmd() { - local desc="release phase" + declare desc="release phase" local cmd="release" local APP="$2"; local IMAGE_SOURCE_TYPE="$3"; local IMAGE_TAG="$4"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") verify_app_name "$APP" diff --git a/plugins/00_dokku-standard/subcommands/report b/plugins/00_dokku-standard/subcommands/report index 38cf15d6b..1a155e744 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() { - local desc="reports dokku vitals for troubleshooting" + declare desc="reports dokku vitals for troubleshooting" local cmd="report" dokku_log_info1 "uname: $(uname -a)" diff --git a/plugins/00_dokku-standard/subcommands/run b/plugins/00_dokku-standard/subcommands/run index b94cee5cc..ff2ca1588 100755 --- a/plugins/00_dokku-standard/subcommands/run +++ b/plugins/00_dokku-standard/subcommands/run @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" dokku_run_cmd() { - local desc="runs command in container based on app image" + declare desc="runs command in container based on app image" local cmd="run" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$2"; local IMAGE_TAG=$(get_running_image_tag "$APP"); local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") diff --git a/plugins/00_dokku-standard/subcommands/trace b/plugins/00_dokku-standard/subcommands/trace index 7982acef1..af9154c40 100755 --- a/plugins/00_dokku-standard/subcommands/trace +++ b/plugins/00_dokku-standard/subcommands/trace @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" dokku_trace_cmd() { - local desc="enables/disables DOKKU_TRACE" + declare desc="enables/disables DOKKU_TRACE" local cmd="trace" [[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc" [[ "$2" == "on" ]] || [[ "$2" == "off" ]] || { diff --git a/plugins/00_dokku-standard/subcommands/version b/plugins/00_dokku-standard/subcommands/version index f26f86a56..99d2c89d1 100755 --- a/plugins/00_dokku-standard/subcommands/version +++ b/plugins/00_dokku-standard/subcommands/version @@ -7,7 +7,7 @@ source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions" dokku_version_cmd() { - local desc="prints dokku version" + declare desc="prints dokku version" local cmd="version" cat "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version" } diff --git a/plugins/20_events/subcommands/default b/plugins/20_events/subcommands/default index 6f800423d..c15f6b278 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() { - local desc="shows contents of dokku events log" + declare desc="shows contents of dokku events log" local cmd="events" if [[ -f $DOKKU_EVENTS_LOGFILE ]]; then if [[ $2 == "-t" ]]; then diff --git a/plugins/20_events/subcommands/list b/plugins/20_events/subcommands/list index 70601fd23..44f4a11e5 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() { - local desc="lists enabled events" + declare desc="lists enabled events" local cmd="events:list" local PLUGIN_DIR="$(dirname "$0")/.." diff --git a/plugins/20_events/subcommands/off b/plugins/20_events/subcommands/off index 69c800683..b746c411a 100755 --- a/plugins/20_events/subcommands/off +++ b/plugins/20_events/subcommands/off @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" events_off_cmd() { - local desc="disables dokku events logger" + declare desc="disables dokku events logger" local cmd="events:off" echo "Disabling dokku events logger" rm -f "$DOKKU_ROOT/.dokkurc/DOKKU_EVENTS" diff --git a/plugins/20_events/subcommands/on b/plugins/20_events/subcommands/on index 931dc5c68..ebb69e873 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() { - local desc="enables dokku events logger" + declare desc="enables dokku events logger" local cmd="events:on" echo "Enabling dokku events logger" [[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc" diff --git a/plugins/apps/functions b/plugins/apps/functions index 1e49f4569..bb51777cc 100755 --- a/plugins/apps/functions +++ b/plugins/apps/functions @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" apps_create() { - local desc="verifies app name and creates an app" + declare desc="verifies app name and creates an app" [[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on" [[ ! "$1" =~ ^[a-z].* && ! "$1" =~ ^[0-9].* ]] && dokku_log_fail "App name must begin with lowercase alphanumeric character" [[ -d "$DOKKU_ROOT/$1" ]] && dokku_log_fail "Name is already taken" diff --git a/plugins/apps/post-delete b/plugins/apps/post-delete index 3ee28e259..9263b31d8 100755 --- a/plugins/apps/post-delete +++ b/plugins/apps/post-delete @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" app_post_delete() { - local desc="apps post-delete plugin trigger" + declare desc="apps post-delete plugin trigger" local trigger="app_post_delete" local APP="$1"; local IMAGE_REPO=$(get_app_image_repo "$APP") [[ -n $APP ]] && rm -rf "${DOKKU_ROOT:?}/$APP" > /dev/null diff --git a/plugins/apps/pre-delete b/plugins/apps/pre-delete index 59d29fe86..086f2714a 100755 --- a/plugins/apps/pre-delete +++ b/plugins/apps/pre-delete @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" apps_pre_delete() { - local desc="apps pre-delete plugin trigger" + declare desc="apps pre-delete plugin trigger" local trigger="apps_pre_delete" local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache" verify_app_name "$APP" diff --git a/plugins/apps/subcommands/create b/plugins/apps/subcommands/create index ef586f730..0f68a1a08 100755 --- a/plugins/apps/subcommands/create +++ b/plugins/apps/subcommands/create @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/apps/functions" apps_create_cmd() { - local desc="creates app via command line" + declare desc="creates app via command line" local cmd="apps:create" apps_create "$2" } diff --git a/plugins/apps/subcommands/default b/plugins/apps/subcommands/default index 910f9ae20..47f5973a6 100755 --- a/plugins/apps/subcommands/default +++ b/plugins/apps/subcommands/default @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" apps_main_cmd() { - local desc="lists all apps" + declare desc="lists all apps" local cmd="apps" local app diff --git a/plugins/apps/subcommands/destroy b/plugins/apps/subcommands/destroy index 72e3d27f5..bfeb43862 100755 --- a/plugins/apps/subcommands/destroy +++ b/plugins/apps/subcommands/destroy @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions" apps_destroy_cmd() { - local desc="destroys an app" + declare desc="destroys an app" local cmd="apps:destroy" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ "$2" == "tls" ]] && dokku_log_fail "Unable to destroy tls directory" diff --git a/plugins/apps/subcommands/rename b/plugins/apps/subcommands/rename index 8b5d3cd11..fef991daf 100755 --- a/plugins/apps/subcommands/rename +++ b/plugins/apps/subcommands/rename @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/apps/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" apps_rename_cmd() { - local desc="renames an app" + declare desc="renames an app" local cmd="apps:rename" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -d "$DOKKU_ROOT/$3" ]] && dokku_log_fail "Name is already taken" diff --git a/plugins/build-env/pre-build-buildpack b/plugins/build-env/pre-build-buildpack index 37cbc6688..ae544b7f4 100755 --- a/plugins/build-env/pre-build-buildpack +++ b/plugins/build-env/pre-build-buildpack @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" build_env_pre_build_buildpack() { - local desc="build-env pre-build-buildpack plugin trigger" + declare desc="build-env pre-build-buildpack plugin trigger" local trigger="build_env_pre_build_buildpack" local APP="$1"; local IMAGE=$(get_app_image_name "$APP"); local BUILD_ENV="" verify_app_name "$APP" diff --git a/plugins/certs/functions b/plugins/certs/functions index ad6e56732..b64a14a56 100755 --- a/plugins/certs/functions +++ b/plugins/certs/functions @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" is_ssl_enabled() { - local desc="returns 0 if ssl is enabled for given app" + declare desc="returns 0 if ssl is enabled for given app" local APP=$1; verify_app_name "$APP" local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls" @@ -15,7 +15,7 @@ is_ssl_enabled() { } get_ssl_hostnames() { - local desc="returns a string of ssl hostnames extracted from an app's ssl certificate" + declare desc="returns a string of ssl hostnames extracted from an app's ssl certificate" local APP=$1; verify_app_name "$APP" local SSL_PATH="$DOKKU_ROOT/$APP/tls" diff --git a/plugins/certs/subcommands/add b/plugins/certs/subcommands/add index 15084ee23..e31710ea6 100755 --- a/plugins/certs/subcommands/add +++ b/plugins/certs/subcommands/add @@ -5,13 +5,13 @@ source "$PLUGIN_AVAILABLE_PATH/certs/functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" is_tar_import() { - local desc="determines if we have STDIN open in an attempt to detect a streamed tar import" + declare desc="determines if we have STDIN open in an attempt to detect a streamed tar import" [[ -t 0 ]] && return 1 return 0 } is_file_import() { - local desc="determines if we have passed in a file and key path for a file import" + declare desc="determines if we have passed in a file and key path for a file import" local CRT_FILE="$1" local KEY_FILE="$2" @@ -29,7 +29,7 @@ is_file_import() { } certs_set() { - local desc="imports an SSL cert/key combo either on STDIN via a tarball or from specified cert/key filenames" + 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" verify_app_name "$2" diff --git a/plugins/certs/subcommands/generate b/plugins/certs/subcommands/generate index 1a7e95cb8..a0fd34262 100755 --- a/plugins/certs/subcommands/generate +++ b/plugins/certs/subcommands/generate @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/domains/functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" certs_generate_cmd() { - local desc="generates a self-signed SSL certificate/key combo" + declare desc="generates a self-signed SSL certificate/key combo" local cmd="certs:generate" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" verify_app_name "$2" diff --git a/plugins/certs/subcommands/info b/plugins/certs/subcommands/info index bfbecdad6..cfda760d8 100755 --- a/plugins/certs/subcommands/info +++ b/plugins/certs/subcommands/info @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/certs/functions" certs_info_cmd() { - local desc="prints SSL certificate info for app" + declare desc="prints SSL certificate info for app" local cmd="certs:info" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" verify_app_name "$2" diff --git a/plugins/certs/subcommands/remove b/plugins/certs/subcommands/remove index 46a93ee13..5a9c5a7e8 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() { - local desc="removes SSL cert/key from specified app" + 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" verify_app_name "$2" diff --git a/plugins/checks/check-deploy b/plugins/checks/check-deploy index fc39656c7..53896ad76 100755 --- a/plugins/checks/check-deploy +++ b/plugins/checks/check-deploy @@ -39,7 +39,7 @@ source "$PLUGIN_AVAILABLE_PATH/checks/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" checks_check_deploy() { - local desc="checks check-deploy plugin trigger" + declare desc="checks check-deploy plugin trigger" local trigger="checks_check_deploy" local APP="$1"; local DOKKU_APP_CONTAINER_ID="$2"; local DOKKU_APP_CONTAINER_TYPE="$3"; local DOKKU_APP_LISTEN_PORT="$4"; local DOKKU_APP_LISTEN_IP="$5" if [[ -z "$DOKKU_APP_LISTEN_PORT" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT" ]]; then @@ -80,7 +80,7 @@ checks_check_deploy() { local FILENAME=${TMPDIR}/CHECKS cleanup() { - local desc="cleans up TMPDIR and print container output" + declare desc="cleans up TMPDIR and print container output" local id="$1" rm -rf "$TMPDIR" if [[ $id ]]; then diff --git a/plugins/checks/functions b/plugins/checks/functions index 3ed9e227a..e0bca091e 100755 --- a/plugins/checks/functions +++ b/plugins/checks/functions @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" is_app_checks_enabled() { - local desc="return app zero-downtime checks status" + declare desc="return app zero-downtime checks status" local APP="$1"; verify_app_name "$APP" local DOKKU_CHECKS_ENABLED=$(config_get "$APP" DOKKU_CHECKS_ENABLED) diff --git a/plugins/checks/install b/plugins/checks/install index 63965ffa6..3d5f6e3da 100755 --- a/plugins/checks/install +++ b/plugins/checks/install @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" migrate_checks_vars() { - local desc="migrates deprecated CHECKS config variables to simplified counter part introduced in 0.5.x" + declare desc="migrates deprecated CHECKS config variables to simplified counter part introduced in 0.5.x" local APPS="$(dokku_apps)" local GLOBAL_SKIP_ALL_CHECKS=$(dokku config:get --global DOKKU_SKIP_ALL_CHECKS || true) local GLOBAL_SKIP_DEFAULT_CHECKS=$(dokku config:get --global DOKKU_SKIP_DEFAULT_CHECKS || true) diff --git a/plugins/checks/subcommands/default b/plugins/checks/subcommands/default index d8b0c70cd..dd584f08b 100755 --- a/plugins/checks/subcommands/default +++ b/plugins/checks/subcommands/default @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" checks_main_cmd() { - local desc="displays app zero-downtime status" + declare desc="displays app zero-downtime status" local cmd="checks" local ALL_APPS=$(dokku_apps) if [[ -n "$1" ]]; then diff --git a/plugins/checks/subcommands/disable b/plugins/checks/subcommands/disable index 314192481..0c5188dc6 100755 --- a/plugins/checks/subcommands/disable +++ b/plugins/checks/subcommands/disable @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" checks_disable_cmd() { - local desc="disable zero-downtime for app" + declare desc="disable zero-downtime for app" local cmd="check:disable" local APP="$1"; verify_app_name "$APP" diff --git a/plugins/checks/subcommands/enable b/plugins/checks/subcommands/enable index b28ef4bd7..98be76bf0 100755 --- a/plugins/checks/subcommands/enable +++ b/plugins/checks/subcommands/enable @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" checks_enable_cmd() { - local desc="enable zero-downtime for app" + declare desc="enable zero-downtime for app" local cmd="checks:enable" local APP="$1"; verify_app_name "$APP" diff --git a/plugins/common/functions b/plugins/common/functions index 86f9c1436..28379bacc 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -2,7 +2,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x has_tty() { - local desc="return 0 if we have a tty" + declare desc="return 0 if we have a tty" if [[ "$(/usr/bin/tty || true)" == "not a tty" ]]; then return 1 else @@ -11,23 +11,23 @@ has_tty() { } dokku_apps() { - local desc="prints list of all local apps" + declare desc="prints list of all local apps" local INSTALLED_APPS=$(find "$DOKKU_ROOT" -follow -maxdepth 1 -mindepth 1 -type d ! -name 'tls' ! -name '.*' -printf "%f\n" | sort) || (dokku_log_fail "You haven't deployed any applications yet") [[ $INSTALLED_APPS ]] && echo "$INSTALLED_APPS" } dokku_log_info1() { - local desc="log info1 formatter" + declare desc="log info1 formatter" echo "-----> $*" } dokku_log_info2() { - local desc="log info2 formatter" + declare desc="log info2 formatter" echo "=====> $*" } dokku_log_info1_quiet() { - local desc="log info1 formatter (with quiet option)" + declare desc="log info1 formatter (with quiet option)" if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then echo "-----> $*" else @@ -36,7 +36,7 @@ dokku_log_info1_quiet() { } dokku_log_info2_quiet() { - local desc="log info2 formatter (with quiet option)" + declare desc="log info2 formatter (with quiet option)" if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then echo "=====> $*" else @@ -45,12 +45,12 @@ dokku_log_info2_quiet() { } dokku_col_log_info1() { - local desc="columnar log info1 formatter" + declare desc="columnar log info1 formatter" printf "%-6s %-18s %-25s %-25s %-25s\n" "----->" "$@" } dokku_col_log_info1_quiet() { - local desc="columnar log info1 formatter (with quiet option)" + declare desc="columnar log info1 formatter (with quiet option)" if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then printf "%-6s %-18s %-25s %-25s %-25s\n" "----->" "$@" else @@ -59,12 +59,12 @@ dokku_col_log_info1_quiet() { } dokku_col_log_info2() { - local desc="columnar log info2 formatter" + declare desc="columnar log info2 formatter" printf "%-6s %-18s %-25s %-25s %-25s\n" "=====>" "$@" } dokku_col_log_info2_quiet() { - local desc="columnar log info2 formatter (with quiet option)" + declare desc="columnar log info2 formatter (with quiet option)" if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then printf "%-6s %-18s %-25s %-25s %-25s\n" "=====>" "$@" else @@ -73,12 +73,12 @@ dokku_col_log_info2_quiet() { } dokku_col_log_msg() { - local desc="columnar log formatter" + declare desc="columnar log formatter" printf "%-25s %-25s %-25s %-25s\n" "$@" } dokku_col_log_msg_quiet() { - local desc="columnar log formatter (with quiet option)" + declare desc="columnar log formatter (with quiet option)" if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then printf "%-25s %-25s %-25s %-25s\n" "$@" else @@ -87,7 +87,7 @@ dokku_col_log_msg_quiet() { } dokku_log_verbose_quiet() { - local desc="log verbose formatter (with quiet option)" + declare desc="log verbose formatter (with quiet option)" if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then echo " $*" else @@ -96,35 +96,35 @@ dokku_log_verbose_quiet() { } dokku_log_verbose() { - local desc="log verbose formatter" + declare desc="log verbose formatter" echo " $*" } dokku_log_warn() { - local desc="log warning formatter" + declare desc="log warning formatter" echo " ! $*" } dokku_log_fail() { - local desc="log fail formatter" + declare desc="log fail formatter" echo "$@" 1>&2 exit 1 } dokku_log_event() { - local desc="log dokku events" + declare desc="log dokku events" logger -t dokku -i -- "$@" } dokku_log_plugn_trigger_call() { - local desc="log plugn trigger calls" + declare desc="log plugn trigger calls" local l_hook="$1" ; shift dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT" } dokku_container_log_verbose_quiet() { - local desc="log verbose container output (with quiet option)" + declare desc="log verbose container output (with quiet option)" local CID=$1; shift @@ -138,7 +138,7 @@ dokku_container_log_verbose_quiet() { } verify_app_name() { - local desc="verify app name format and app existence" + declare desc="verify app name format and app existence" local APP="$1" [[ ! -n "$APP" ]] && dokku_log_fail "(verify_app_name) APP must not be null" if [[ ! "$APP" =~ ^[a-z].* && ! "$APP" =~ ^[0-9].* ]]; then @@ -151,7 +151,7 @@ verify_app_name() { } verify_image() { - local desc="verify image existence" + declare desc="verify image existence" local IMAGE="$1" if (docker inspect "$IMAGE" &>/dev/null); then return 0 @@ -161,14 +161,14 @@ verify_image() { } get_app_image_repo() { - local desc="central definition of image repo pattern" + declare desc="central definition of image repo pattern" local APP="$1"; local IMAGE_REPO="dokku/$APP" [[ -z "$APP" ]] && dokku_log_fail "(get_app_image_repo) APP must not be null" echo "$IMAGE_REPO" } get_app_image_name() { - local desc="return image identifier for a given app, tag tuple. validate if tag is presented" + declare desc="return image identifier for a given app, tag tuple. validate if tag is presented" local APP="$1"; local IMAGE_TAG="$2"; local IMAGE_REPO=$(get_app_image_repo "$APP") [[ -z "$APP" ]] && dokku_log_fail "(get_app_image_name) APP must not be null" @@ -182,7 +182,7 @@ get_app_image_name() { } get_running_image_tag() { - local desc="retrieve current image tag for a given app. returns empty string if no deployed containers are found" + declare desc="retrieve current image tag for a given app. returns empty string if no deployed containers are found" local APP="$1" [[ ! -n "$APP" ]] && dokku_log_fail "(get_running_image_tag) APP must not be null" verify_app_name "$APP" @@ -193,14 +193,14 @@ get_running_image_tag() { } is_image_herokuish_based() { - local desc="returns true if app image is based on herokuish" + declare desc="returns true if app image is based on herokuish" # circleci can't support --rm as they run lxc in lxc [[ ! -f "/home/ubuntu/.circlerc" ]] && local DOCKER_ARGS="--rm" docker run "$DOKKU_GLOBAL_RUN_ARGS" --entrypoint="/bin/sh" $DOCKER_ARGS "$@" -c "test -f /exec" } is_number() { - local desc="returns 0 if input is a number" + declare desc="returns 0 if input is a number" local NUMBER=$1; local NUM_RE='^[0-9]+$' if [[ $NUMBER =~ $NUM_RE ]]; then return 0 @@ -210,7 +210,7 @@ is_number() { } is_abs_path() { - local desc="returns 0 if input path is absolute" + declare desc="returns 0 if input path is absolute" local TEST_PATH=$1 if [[ "$TEST_PATH" == /* ]]; then return 0 @@ -220,7 +220,7 @@ is_abs_path() { } parse_args() { - local desc="top-level cli arg parser" + declare desc="top-level cli arg parser" local next_index=1; local skip=false; local args=("$@") for arg in "$@"; do $skip && skip=false && continue @@ -247,7 +247,7 @@ parse_args() { } copy_from_image() { - local desc="copy file from named image to destination" + declare desc="copy file from named image to destination" local IMAGE="$1"; local SRC_FILE="$2"; local DST_DIR="$3" verify_app_name "$APP" @@ -266,7 +266,7 @@ copy_from_image() { } get_app_container_ids() { - local desc="returns list of docker container ids for given app" + declare desc="returns list of docker container ids for given app" local APP="$1"; local CONTAINER_TYPE="$2" verify_app_name "$APP" [[ -f $DOKKU_ROOT/$APP/CONTAINER ]] && DOKKU_CIDS+=$(< "$DOKKU_ROOT/$APP/CONTAINER") @@ -293,7 +293,7 @@ get_app_container_ids() { } get_app_running_container_ids() { - local desc="return list of running docker container ids for given apps" + declare desc="return list of running docker container ids for given apps" local APP=$1 verify_app_name "$APP" @@ -309,7 +309,7 @@ get_app_running_container_ids() { } get_cmd_from_procfile() { - local desc="parse cmd from app Procfile" + declare desc="parse cmd from app Procfile" local APP=$1; local PROC_TYPE=$2; local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" local name; local command; verify_app_name "$APP" @@ -327,7 +327,7 @@ get_cmd_from_procfile() { } is_deployed() { - local desc="return 0 if given app has a running container" + declare desc="return 0 if given app has a running container" local APP="$1" if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] || [[ $(ls "$DOKKU_ROOT/$APP"/CONTAINER.* &> /dev/null; echo $?) -eq 0 ]]; then return 0 @@ -337,7 +337,7 @@ is_deployed() { } is_container_running () { - local desc="return 0 if given docker container id is in running state" + declare desc="return 0 if given docker container id is in running state" local CID=$1 local CONTAINER_STATUS=$(docker inspect -f '{{.State.Running}}' "$CID" || true) @@ -349,7 +349,7 @@ is_container_running () { } is_container_status () { - local desc="return 0 if given docker container id is in given state" + declare desc="return 0 if given docker container id is in given state" local CID=$1 local TEMPLATE="{{.State.$2}}" local CONTAINER_STATUS=$(docker inspect -f "$TEMPLATE" "$CID" || true) @@ -362,7 +362,7 @@ is_container_status () { } is_app_running() { - local desc="return 0 if given app has a running container" + declare desc="return 0 if given app has a running container" local APP="$1" verify_app_name "$APP" @@ -376,7 +376,7 @@ is_app_running() { } release_and_deploy() { - local desc="main function for releasing and deploying an app" + declare desc="main function for releasing and deploying an app" source "$PLUGIN_AVAILABLE_PATH/config/functions" local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") @@ -411,7 +411,7 @@ release_and_deploy() { } docker_cleanup() { - local desc="cleans up all exited/dead containers and removes all dangling images" + declare desc="cleans up all exited/dead containers and removes all dangling images" # delete all non-running containers # shellcheck disable=SC2046 docker rm $(docker ps -a -f 'status=exited' -q) &> /dev/null || true @@ -426,7 +426,7 @@ docker_cleanup() { } get_available_port() { - local desc="returns first currently unused port > 1024" + declare desc="returns first currently unused port > 1024" while true; do local port=$(shuf -i 1025-65535 -n 1) if ! nc -z 0.0.0.0 "$port"; then @@ -439,7 +439,7 @@ get_available_port() { } dokku_auth() { - local desc="calls user-auth plugin trigger" + declare desc="calls user-auth plugin trigger" export SSH_USER=${SSH_USER:=$USER} export SSH_NAME=${NAME:="default"} if ! plugn trigger user-auth "$SSH_USER" "$SSH_NAME" "$@" ; then @@ -449,12 +449,12 @@ dokku_auth() { } _ipv4_regex() { - local desc="ipv4 regex" + declare desc="ipv4 regex" echo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" } _ipv6_regex() { - local desc="ipv6 regex" + declare desc="ipv6 regex" local RE_IPV4="$(_ipv4_regex)" local RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8 local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7:: @@ -472,7 +472,7 @@ _ipv6_regex() { } get_ipv4_regex() { - local desc="returns ipv4 regex" + declare desc="returns ipv4 regex" local RE_IPV4="$(_ipv4_regex)" # Ensure the ip address continues to the end of the line # Fixes using a wildcard dns service such as xip.io which allows for *..xip.io @@ -480,7 +480,7 @@ get_ipv4_regex() { } get_ipv6_regex() { - local desc="returns ipv6 regex" + declare desc="returns ipv6 regex" local RE_IPV6="$(_ipv6_regex)" # Ensure the ip address continues to the end of the line # Fixes using a wildcard dns service such as xip.io which allows for *..xip.io @@ -488,14 +488,14 @@ get_ipv6_regex() { } get_global_vhost() { - local desc="return global vhost" + declare desc="return global vhost" local GLOBAL_VHOST_FILE="$DOKKU_ROOT/VHOST" [[ -f "$GLOBAL_VHOST_FILE" ]] && local GLOBAL_VHOST=$(< "$GLOBAL_VHOST_FILE") echo "$GLOBAL_VHOST" } is_global_vhost_enabled() { - local desc="returns true if we have a valid global vhost set; otherwise returns false" + declare desc="returns true if we have a valid global vhost set; otherwise returns false" local GLOBAL_VHOST=$(get_global_vhost) local GLOBAL_VHOST_ENABLED=true local RE_IPV4="$(get_ipv4_regex)" @@ -508,7 +508,7 @@ is_global_vhost_enabled() { } is_app_vhost_enabled() { - local desc="returns true or false if vhost support is enabled for a given application" + declare desc="returns true or false if vhost support is enabled for a given application" source "$PLUGIN_AVAILABLE_PATH/config/functions" local APP=$1; verify_app_name "$APP" @@ -523,7 +523,7 @@ is_app_vhost_enabled() { } disable_app_vhost() { - local desc="disable vhost support for given application" + declare desc="disable vhost support for given application" source "$PLUGIN_AVAILABLE_PATH/config/functions" local APP=$1; verify_app_name "$APP" @@ -553,7 +553,7 @@ disable_app_vhost() { } enable_app_vhost() { - local desc="enable vhost support for given application" + declare desc="enable vhost support for given application" source "$PLUGIN_AVAILABLE_PATH/config/functions" local APP=$1; verify_app_name "$APP" @@ -565,13 +565,13 @@ enable_app_vhost() { } get_dockerfile_exposed_ports() { - local desc="return all exposed ports from passed file path" + declare desc="return all exposed ports from passed file path" local DOCKERFILE_PORTS=$(egrep "^EXPOSE " "$1" | awk '{ print $2 }' | xargs) || true echo "$DOCKERFILE_PORTS" } get_app_raw_tcp_ports() { - local desc="extracts raw tcp port numbers from DOCKERFILE_PORTS config variable" + declare desc="extracts raw tcp port numbers from DOCKERFILE_PORTS config variable" source "$PLUGIN_AVAILABLE_PATH/config/functions" local APP="$1"; verify_app_name "$APP" @@ -587,7 +587,7 @@ get_app_raw_tcp_ports() { } get_container_ports() { - local desc="returns published ports from app containers" + declare desc="returns published ports from app containers" local APP="$1"; verify_app_name "$APP" local APP_CIDS="$(get_app_container_ids "$APP")" local cid @@ -600,7 +600,7 @@ get_container_ports() { } get_app_urls() { - local desc="print an app's available urls" + declare desc="print an app's available urls" source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions" @@ -668,7 +668,7 @@ get_app_urls() { } get_json_value() { - local desc="return value of provided json key from a json stream on stdin" + declare desc="return value of provided json key from a json stream on stdin" # JSON_NODE should be expresses as either a top-level object that has no children # or in the format of json.node.path local JSON_NODE="$1" @@ -678,7 +678,7 @@ get_json_value() { } get_json_keys() { - local desc="return space-separated list of json keys from json provided on stdin" + declare desc="return space-separated list of json keys from json provided on stdin" # JSON_NODE should be expressed as json.node.path and is expected to have children local JSON_NODE="$1" local JSON_NODE=${JSON_NODE//\./\"][\"} diff --git a/plugins/config/docker-args-deploy b/plugins/config/docker-args-deploy index 4e56133c4..b6d0bf534 100755 --- a/plugins/config/docker-args-deploy +++ b/plugins/config/docker-args-deploy @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" config_docker_args() { - local desc="config docker-args plugin trigger" + declare desc="config docker-args plugin trigger" local trigger="$0 config_docker_args" local STDIN=$(cat); local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") local DOCKERFILE_ENV_FILE="$DOKKU_ROOT/$APP/DOCKERFILE_ENV_FILE" diff --git a/plugins/config/functions b/plugins/config/functions index 02f41b3f6..ec515096d 100644 --- a/plugins/config/functions +++ b/plugins/config/functions @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" config_export() { - local desc="returns export command for config variable of specified type (app/global)" + declare desc="returns export command for config variable of specified type (app/global)" local CONFIG_TYPE="$1" local APP="$2" local ENV_FILE="$DOKKU_ROOT/$APP/ENV" @@ -18,7 +18,7 @@ config_export() { } config_parse_args() { - local desc="parse config plugin args" + declare desc="parse config plugin args" unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART case "$2" in --global) @@ -50,13 +50,13 @@ config_parse_args() { } config_create () { - local desc="create config env file" + declare desc="create config env file" local ENV_FILE=$1 [[ -f $ENV_FILE ]] || touch "$ENV_FILE" } config_styled_hash () { - local desc="internal config hash" + declare desc="internal config hash" local vars="$1" local prefix="$2" local longest="" @@ -83,7 +83,7 @@ config_styled_hash () { } config_write() { - local desc="writes config vars out to appropriate file path" + declare desc="writes config vars out to appropriate file path" local ENV_TEMP="$1" local ENV_FILE_TEMP="${ENV_FILE}.tmp" @@ -96,7 +96,7 @@ config_write() { } is_config_export() { - local desc="return 0 if we're supposed to export" + declare desc="return 0 if we're supposed to export" for var in "$@"; do if [[ "$var" == "--export" ]]; then return 0 @@ -106,7 +106,7 @@ is_config_export() { } config_all() { - local desc="print or export config vars" + declare desc="print or export config vars" [[ "$1" == "config" ]] || set -- "config" "$@" config_parse_args "$@" @@ -130,7 +130,7 @@ config_all() { } config_get() { - local desc="get value of given config var" + declare desc="get value of given config var" [[ "$1" == "config:get" ]] || set -- "config:get" "$@" config_parse_args "$@" @@ -151,7 +151,7 @@ config_get() { } config_set() { - local desc="set value of given config var" + declare desc="set value of given config var" [[ "$1" == "config:set" ]] || set -- "config:set" "$@" config_parse_args "$@" [[ "$2" = "--no-restart" ]] && set -- "${@:1:1}" "${@:3}" @@ -209,7 +209,7 @@ ${var}" } config_unset() { - local desc="unset given config var" + declare desc="unset given config var" [[ "$1" == "config:unset" ]] || set -- "config:unset" "$@" config_parse_args "$@" [[ "$2" = "--no-restart" ]] && set -- "${@:1:1}" "${@:3}" diff --git a/plugins/config/subcommands/default b/plugins/config/subcommands/default index 47837d4c1..2a266cc81 100755 --- a/plugins/config/subcommands/default +++ b/plugins/config/subcommands/default @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/config/functions" config_main_cmd() { - local desc="print config vars for app via command line" + declare desc="print config vars for app via command line" local cmd="config" config_all "$@" } diff --git a/plugins/config/subcommands/get b/plugins/config/subcommands/get index ba514b8d2..6a0822ab4 100755 --- a/plugins/config/subcommands/get +++ b/plugins/config/subcommands/get @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/config/functions" config_get_cmd() { - local desc="get specified config vars from app via command line" + declare desc="get specified config vars from app via command line" local cmd="config:get" config_get "$@" } diff --git a/plugins/config/subcommands/set b/plugins/config/subcommands/set index ef30dd4ed..54253d3aa 100755 --- a/plugins/config/subcommands/set +++ b/plugins/config/subcommands/set @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/config/functions" config_set_cmd() { - local desc="set specified config vars for app via command line" + declare desc="set specified config vars for app via command line" local cmd="config:set" config_set "$@" } diff --git a/plugins/config/subcommands/unset b/plugins/config/subcommands/unset index 4569c5793..abb864d03 100755 --- a/plugins/config/subcommands/unset +++ b/plugins/config/subcommands/unset @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/config/functions" config_unset_cmd() { - local desc="unset specified config vars for app via command line" + declare desc="unset specified config vars for app via command line" local cmd="config:unset" config_unset "$@" } diff --git a/plugins/docker-options/docker-args-deploy b/plugins/docker-options/docker-args-deploy index b33a9e872..7d71f39eb 100755 --- a/plugins/docker-options/docker-args-deploy +++ b/plugins/docker-options/docker-args-deploy @@ -2,7 +2,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x docker_args() { - local desc="docker args plugin trigger" + declare desc="docker args plugin trigger" local trigger="$0" local STDIN=$(cat) local APP="$1"; local IMAGE_SOURCE_TYPE="$2" diff --git a/plugins/docker-options/functions b/plugins/docker-options/functions index 783af703a..d49ba305d 100644 --- a/plugins/docker-options/functions +++ b/plugins/docker-options/functions @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" AVAILABLE_PHASES=(build deploy run) get_phase_file_path() { - local desc="return docker-options config file path for specified phase" + declare desc="return docker-options config file path for specified phase" local phase_file_prefix="DOCKER_OPTIONS_" local phase=$1 [[ "$DOKKU_ROOT" && "$APP" && "$phase_file_prefix" && "$phase" ]] || dokku_log_fail "Error: phase_file_path is incomplete." @@ -13,7 +13,7 @@ get_phase_file_path() { } get_phases() { - local desc="returns array of passed passes if all are in allowed array" + declare desc="returns array of passed passes if all are in allowed array" local passed_phases_list="$1" local -r phases_allowed=$(sed -e 's/ /\|/g' <<< "${AVAILABLE_PHASES[@]}") local phase @@ -30,7 +30,7 @@ get_phases() { } create_phase_file_if_required() { - local desc="create phase file" + declare desc="create phase file" local phase_file_path="$1" [[ -f "$phase_file_path" ]] || { touch "$phase_file_path" @@ -38,7 +38,7 @@ create_phase_file_if_required() { } display_phase_options() { - local desc="print docker-options for specified phase" + declare desc="print docker-options for specified phase" local phase="$1" local phase_file_path="$2" echo "${phase^} options:" @@ -46,7 +46,7 @@ display_phase_options() { } display_all_phases_options() { - local desc="print docker-options for all phases" + declare desc="print docker-options for all phases" local phases=("${AVAILABLE_PHASES[@]}") for phase in "${phases[@]}"; do local phase_file_path="$(get_phase_file_path "$phase")" @@ -57,7 +57,7 @@ display_all_phases_options() { } display_passed_phases_options() { - local desc="print docker options for list of specified phases" + declare desc="print docker options for list of specified phases" local passed_phases=("${!1}") local phase for phase in "${passed_phases[@]}"; do @@ -71,7 +71,7 @@ display_passed_phases_options() { } add_passed_docker_option() { - local desc="adds docker option to specified phases" + declare desc="adds docker option to specified phases" local passed_phases=("${!1}") shift local passed_option_string="$*" @@ -86,7 +86,7 @@ add_passed_docker_option() { } remove_passed_docker_option() { - local desc="removes docker option from specified phases" + declare desc="removes docker option from specified phases" local passed_phases=("${!1}") shift local passed_option_string="$*" diff --git a/plugins/docker-options/subcommands/add b/plugins/docker-options/subcommands/add index 3493a65b8..b66576539 100755 --- a/plugins/docker-options/subcommands/add +++ b/plugins/docker-options/subcommands/add @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions" docker_options_add_cmd() { - local desc="Add a docker option to application" + declare desc="Add a docker option to application" local cmd="docker-options:add" verify_app_name "$2" && local APP="$2" diff --git a/plugins/docker-options/subcommands/default b/plugins/docker-options/subcommands/default index 742dee2b4..25d4580d5 100755 --- a/plugins/docker-options/subcommands/default +++ b/plugins/docker-options/subcommands/default @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions" docker_options_main_cmd() { - local desc="Display applications docker options" + declare desc="Display applications docker options" local cmd="docker-options" verify_app_name "$2" && local APP="$2" diff --git a/plugins/docker-options/subcommands/remove b/plugins/docker-options/subcommands/remove index 52d98f018..f232083ef 100755 --- a/plugins/docker-options/subcommands/remove +++ b/plugins/docker-options/subcommands/remove @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions" docker_options_remove_cmd() { - local desc="Remove a docker option from application" + declare desc="Remove a docker option from application" local cmd="docker-options:remove" verify_app_name "$2" && local APP="$2" diff --git a/plugins/domains/functions b/plugins/domains/functions index 79e032262..1326d8241 100755 --- a/plugins/domains/functions +++ b/plugins/domains/functions @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" get_app_domains() { - local desc="return app domains" + declare desc="return app domains" verify_app_name "$1" local APP=$1; local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST" local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST" @@ -21,7 +21,7 @@ get_app_domains() { } get_default_vhost() { - local desc="return default vhost" + declare desc="return default vhost" verify_app_name "$1" local APP="$1"; local RE_IPV4="$(get_ipv4_regex)"; local RE_IPV6="$(get_ipv6_regex)" @@ -44,7 +44,7 @@ get_default_vhost() { } domains_setup() { - local desc="setup domains to default state" + declare desc="setup domains to default state" verify_app_name "$1" local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"; local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST" local RE_IPV4="$(get_ipv4_regex)"; local RE_IPV6="$(get_ipv6_regex)" @@ -62,7 +62,7 @@ domains_setup() { } domains_add() { - local desc="add list of domains to app" + declare desc="add list of domains to app" verify_app_name "$1" local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST" @@ -85,7 +85,7 @@ domains_add() { } domains_remove() { - local desc="remove list of app domains" + declare desc="remove list of app domains" verify_app_name "$1" local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST" local DEFAULT_VHOST="$(get_default_vhost "$APP")" @@ -99,7 +99,7 @@ domains_remove() { } domains_disable() { - local desc="disable domains/VHOST support" + declare desc="disable domains/VHOST support" verify_app_name "$1" local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST" @@ -111,7 +111,7 @@ domains_disable() { } domains_enable() { - local desc="enable domains/VHOST support" + declare desc="enable domains/VHOST support" verify_app_name "$1" local APP="$1"; local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST" local DEFAULT_VHOST="$(get_default_vhost "$APP")" @@ -128,7 +128,7 @@ domains_enable() { } domains_set_global() { - local desc="set global domain name" + declare desc="set global domain name" local NEW_GLOBAL_VHOST="$1"; local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST" if [[ -n "$NEW_GLOBAL_VHOST" ]]; then diff --git a/plugins/domains/subcommands/add b/plugins/domains/subcommands/add index 99de16a59..b58d45a20 100755 --- a/plugins/domains/subcommands/add +++ b/plugins/domains/subcommands/add @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_add_cmd() { - local desc="adds domain to app via command line" + declare desc="adds domain to app via command line" local cmd="domains:add" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" diff --git a/plugins/domains/subcommands/clear b/plugins/domains/subcommands/clear index ff8db2c73..ca4a19be4 100755 --- a/plugins/domains/subcommands/clear +++ b/plugins/domains/subcommands/clear @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_clear_cmd() { - local desc="clear all app domains" + declare desc="clear all app domains" local cmd="domains:clear" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" verify_app_name "$2" diff --git a/plugins/domains/subcommands/default b/plugins/domains/subcommands/default index ee6204b9b..7bf731c04 100755 --- a/plugins/domains/subcommands/default +++ b/plugins/domains/subcommands/default @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_main_cmd() { - local desc="print app domains" + declare desc="print app domains" local cmd="domains" local APP="$2" diff --git a/plugins/domains/subcommands/disable b/plugins/domains/subcommands/disable index 2fdd17441..c32f3ab78 100755 --- a/plugins/domains/subcommands/disable +++ b/plugins/domains/subcommands/disable @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_disable_cmd() { - local desc="disable domains/VHOST support via command line" + 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" diff --git a/plugins/domains/subcommands/enable b/plugins/domains/subcommands/enable index 399f9f723..195b1d4d8 100755 --- a/plugins/domains/subcommands/enable +++ b/plugins/domains/subcommands/enable @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_enable_cmd() { - local desc="enable domains/VHOST support via command line" + 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" diff --git a/plugins/domains/subcommands/remove b/plugins/domains/subcommands/remove index 745bf82ce..1d0e44695 100755 --- a/plugins/domains/subcommands/remove +++ b/plugins/domains/subcommands/remove @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_remove_cmd() { - local desc="removes domains from app via command line" + 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" diff --git a/plugins/domains/subcommands/set-global b/plugins/domains/subcommands/set-global index 6b0c7f6b8..18ae15a11 100755 --- a/plugins/domains/subcommands/set-global +++ b/plugins/domains/subcommands/set-global @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_set_global_cmd() { - local desc="set global domain name from command line" + declare desc="set global domain name from command line" local cmd="domains:set-global" [[ -z $2 ]] && dokku_log_fail "Please specify a global domain name" domains_set_global "$2" diff --git a/plugins/domains/subcommands/setup b/plugins/domains/subcommands/setup index d2999f2f2..0c0bd345f 100755 --- a/plugins/domains/subcommands/setup +++ b/plugins/domains/subcommands/setup @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_setup_cmd() { - local desc="setup domains to default state via command line" + 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" diff --git a/plugins/enter/subcommands/default b/plugins/enter/subcommands/default index 79600ef8e..ab6634142 100755 --- a/plugins/enter/subcommands/default +++ b/plugins/enter/subcommands/default @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" enter_default_cmd() { - local desc="enters running app container of specified proc type" + declare desc="enters running app container of specified proc type" local cmd="enter" local APP="$2"; local CONTAINER_TYPE="$3"; local IMAGE_TAG=$(get_running_image_tag "$APP"); local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") verify_app_name "$APP" diff --git a/plugins/git/commands b/plugins/git/commands index 759b37a81..8ace412ee 100755 --- a/plugins/git/commands +++ b/plugins/git/commands @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/apps/functions" git_build_app_repo() { - local desc="builds local git app repo for app" + declare desc="builds local git app repo for app" verify_app_name "$1" local APP="$1"; local REV="$2" @@ -42,7 +42,7 @@ git_build_app_repo() { } git_hook_cmd() { - local desc="kick off receive-app trigger from git prereceive hook" + declare desc="kick off receive-app trigger from git prereceive hook" local cmd="git-hook" local APP="$2" @@ -67,7 +67,7 @@ git_hook_cmd() { } git_upload_pack_cmd() { - local desc="executes git-upload-pack" + declare desc="executes git-upload-pack" local cmd="git-upload-pack" local APP="$(echo "$2" | perl -pe 's/(?" echo " display recent log output" echo "" diff --git a/plugins/logs/subcommands/default b/plugins/logs/subcommands/default index 65d65e1ed..e97480c6a 100755 --- a/plugins/logs/subcommands/default +++ b/plugins/logs/subcommands/default @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" logs_default_cmd() { - local desc="shows the last logs for an app via command line" + declare desc="shows the last logs for an app via command line" local cmd="logs" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$2"; verify_app_name "$2" diff --git a/plugins/named-containers/post-deploy b/plugins/named-containers/post-deploy index 32006565e..4fbc60c7c 100755 --- a/plugins/named-containers/post-deploy +++ b/plugins/named-containers/post-deploy @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" named_containers_post_deploy() { - local desc="names deployed app container is consistent manner" + declare desc="names deployed app container is consistent manner" local trigger="named_containers_post_deploy" local APP="$1"; local APP_ROOT="$DOKKU_ROOT/$APP" [[ -z $(stat -t "$APP_ROOT"/CONTAINER.* 2>/dev/null) ]] && exit 0 diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index 040e44c76..ae5f9ed9b 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -7,7 +7,7 @@ source "$PLUGIN_AVAILABLE_PATH/domains/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" validate_nginx() { - local desc="validate entire nginx config" + declare desc="validate entire nginx config" set +e sudo /usr/sbin/nginx -t > /dev/null 2>&1 local exit_code=$? @@ -19,7 +19,7 @@ validate_nginx() { } restart_nginx() { - local desc="restart nginx for given distros" + declare desc="restart nginx for given distros" case "$DOKKU_DISTRO" in debian) sudo /usr/sbin/invoke-rc.d nginx reload > /dev/null @@ -40,7 +40,7 @@ restart_nginx() { } nginx_logs() { - local desc="display app nginx logs" + declare desc="display app nginx logs" local APP="$2"; verify_app_name "$APP" local NGINX_LOGS_TYPE=${1#nginx:} local NGINX_LOGS_TYPE=${NGINX_LOGS_TYPE%-logs} @@ -56,7 +56,7 @@ nginx_logs() { } configure_nginx_ports() { - local desc="configure nginx listening ports" + declare desc="configure nginx listening ports" local APP=$1; verify_app_name "$APP" local RAW_TCP_PORTS="$(get_app_raw_tcp_ports "$APP")" local DOKKU_NGINX_PORT=$(config_get "$APP" DOKKU_NGINX_PORT) @@ -89,7 +89,7 @@ configure_nginx_ports() { } validate_ssl_domains() { - local desc="check configured domains against SSL cert contents and show warning if mismatched" + declare desc="check configured domains against SSL cert contents and show warning if mismatched" local APP=$1; verify_app_name "$APP" local SSL_HOSTNAME=$(get_ssl_hostnames "$APP") local SSL_HOSTNAME_REGEX=$(echo "$SSL_HOSTNAME" | xargs | sed 's|\.|\\.|g' | sed 's/\*/\[^\.\]\*/g' | sed 's/ /|/g') @@ -110,7 +110,7 @@ validate_ssl_domains() { } get_custom_nginx_template() { - local desc="attempts to copy custom nginx template from app image" + declare desc="attempts to copy custom nginx template from app image" local APP="$1"; verify_app_name "$APP" local DESTINATION="$2" local IMAGE_TAG="$(get_running_image_tag "$APP")" @@ -121,7 +121,7 @@ get_custom_nginx_template() { } nginx_build_config() { - local desc="build nginx config to proxy app containers using sigil" + declare desc="build nginx config to proxy app containers using sigil" local APP="$1"; verify_app_name "$APP" local DOKKU_APP_LISTEN_PORT="$2"; local DOKKU_APP_LISTEN_IP="$3" local VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"; local URLS_PATH="$DOKKU_ROOT/$APP/URLS" diff --git a/plugins/nginx-vhosts/post-deploy b/plugins/nginx-vhosts/post-deploy index c19804360..f716b0715 100755 --- a/plugins/nginx-vhosts/post-deploy +++ b/plugins/nginx-vhosts/post-deploy @@ -6,7 +6,7 @@ source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions" nginx_post_deploy() { - local desc="nginx-vhosts post-deploy plugin trigger" + declare desc="nginx-vhosts post-deploy plugin trigger" local trigger="nginx_post_deploy" local APP="$1" if [[ -f "$DOKKU_ROOT/$APP/IP.web.1" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT.web.1" ]]; then diff --git a/plugins/nginx-vhosts/post-domains-update b/plugins/nginx-vhosts/post-domains-update index 36cf13ef6..6201175b7 100755 --- a/plugins/nginx-vhosts/post-domains-update +++ b/plugins/nginx-vhosts/post-domains-update @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions" nginx_post_domains_update() { - local desc="calls nginx build_config when domains are updated" + declare desc="calls nginx build_config when domains are updated" local trigger="nginx_post_domains_update" if [[ "$(get_app_proxy_type "$1")" == "nginx" ]]; then nginx_build_config "$1" diff --git a/plugins/nginx-vhosts/proxy-disable b/plugins/nginx-vhosts/proxy-disable index 50447e6e9..512863078 100755 --- a/plugins/nginx-vhosts/proxy-disable +++ b/plugins/nginx-vhosts/proxy-disable @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions" nginx_proxy_disable() { - local desc="disable nginx proxy" + declare desc="disable nginx proxy" local trigger="nginx_proxy_disable" local APP="$1"; verify_app_name "$APP" diff --git a/plugins/nginx-vhosts/proxy-enable b/plugins/nginx-vhosts/proxy-enable index 1ceddd952..a4fe26edd 100755 --- a/plugins/nginx-vhosts/proxy-enable +++ b/plugins/nginx-vhosts/proxy-enable @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions" nginx_proxy_enable() { - local desc="enable nginx proxy" + declare desc="enable nginx proxy" local trigger="nginx_proxy_enable" local APP="$1"; verify_app_name "$APP" diff --git a/plugins/nginx-vhosts/subcommands/access-logs b/plugins/nginx-vhosts/subcommands/access-logs index 8ad94cf53..5b8fa8990 100755 --- a/plugins/nginx-vhosts/subcommands/access-logs +++ b/plugins/nginx-vhosts/subcommands/access-logs @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" nginx_logs_cmd() { - local desc="display app nginx logs from command line" + declare desc="display app nginx logs from command line" local cmd="$1" [[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 nginx_logs "$@" diff --git a/plugins/nginx-vhosts/subcommands/build-config b/plugins/nginx-vhosts/subcommands/build-config index 185c4e2f6..212c8ef15 100755 --- a/plugins/nginx-vhosts/subcommands/build-config +++ b/plugins/nginx-vhosts/subcommands/build-config @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" nginx_build_config_cmd() { - local desc="build nginx config to proxy app containers from command line" + declare desc="build nginx config to proxy app containers from command line" local cmd="nginx:build-config" [[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 nginx_build_config "$2" diff --git a/plugins/plugin/functions b/plugins/plugin/functions index 9376a4add..f2713c158 100755 --- a/plugins/plugin/functions +++ b/plugins/plugin/functions @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" disable_plugin() { - local desc="disables specified plugin name" + declare desc="disables specified plugin name" local PLUGIN="$1" [[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot disable a core plugin" [[ ! -e $PLUGIN_ENABLED_PATH/$PLUGIN ]] && dokku_log_fail "Plugin already disabled" @@ -13,7 +13,7 @@ disable_plugin() { } enable_plugin() { - local desc="enables specified plugin name" + declare desc="enables specified plugin name" local PLUGIN="$1" [[ -e $PLUGIN_ENABLED_PATH/$PLUGIN ]] && dokku_log_fail "Plugin already enabled" [[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin does not exist" @@ -22,14 +22,14 @@ enable_plugin() { } download_plugin() { - local desc="download plugin from URL and set name" + declare desc="download plugin from URL and set name" local PLUGIN_GIT_URL="$1" local PLUGIN_NAME="$2" plugn install "$PLUGIN_GIT_URL" "$PLUGIN_NAME" } download_and_enable_plugin() { - local desc="wrapper to download and enable specified version of plugin" + declare desc="wrapper to download and enable specified version of plugin" local PLUGIN_GIT_URL="$1" shift while getopts ":-:" opt "$@"; do @@ -58,7 +58,7 @@ download_and_enable_plugin() { } update_plugin() { - local desc="update plugin" + declare desc="update plugin" local PLUGIN="$1" local PLUGIN_COMMITTISH="$2" [[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed" @@ -66,7 +66,7 @@ update_plugin() { } uninstall_plugin() { - local desc="uninstall plugin" + declare desc="uninstall plugin" local PLUGIN="$1" [[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot uninstall a core plugin" [[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed" @@ -75,7 +75,7 @@ uninstall_plugin() { } plugin_name() { - local desc="default plugin name" + declare desc="default plugin name" local PLUGIN_GIT_URL="$1" echo "$PLUGIN_GIT_URL" | awk -F '/' '{ print $NF }' | sed -e "s:.git::g" | sed 's:^dokku-::' } diff --git a/plugins/plugin/subcommands/default b/plugins/plugin/subcommands/default index 5bfb31b35..61152d7bb 100755 --- a/plugins/plugin/subcommands/default +++ b/plugins/plugin/subcommands/default @@ -2,7 +2,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x plugin_main_cmd() { - local desc="shows details about locally installed plugins" + declare desc="shows details about locally installed plugins" local cmd="plugin" plugn version plugn list diff --git a/plugins/plugin/subcommands/disable b/plugins/plugin/subcommands/disable index f48427a0d..207b6766a 100755 --- a/plugins/plugin/subcommands/disable +++ b/plugins/plugin/subcommands/disable @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/plugin/functions" plugin_disable_cmd() { - local desc="disables plugin via command line" + declare desc="disables plugin via command line" local cmd="plugin:disable" [[ -z $2 ]] && dokku_log_fail "Please specify a plugin to disable" local PLUGIN="$2" diff --git a/plugins/plugin/subcommands/enable b/plugins/plugin/subcommands/enable index 92a53c213..624393e5b 100755 --- a/plugins/plugin/subcommands/enable +++ b/plugins/plugin/subcommands/enable @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/plugin/functions" plugin_enable_cmd() { - local desc="enables plugin via command line" + declare desc="enables plugin via command line" local cmd="plugin:enable" [[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable" local PLUGIN="$2" diff --git a/plugins/plugin/subcommands/install b/plugins/plugin/subcommands/install index 93e9ff66b..1ad4143f1 100755 --- a/plugins/plugin/subcommands/install +++ b/plugins/plugin/subcommands/install @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/plugin/functions" plugin_install_cmd() { - local desc="installs a plugin from URL and calls install plugin trigger via command line" + declare desc="installs a plugin from URL and calls install plugin trigger via command line" local cmd="plugin:install" case "$2" in --core) diff --git a/plugins/plugin/subcommands/install-dependencies b/plugins/plugin/subcommands/install-dependencies index 25f520cad..13a2ca079 100755 --- a/plugins/plugin/subcommands/install-dependencies +++ b/plugins/plugin/subcommands/install-dependencies @@ -2,7 +2,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x plugin_install_dependencies_cmd() { - local desc="calls dependencies plugin trigger via command line" + declare desc="calls dependencies plugin trigger via command line" local cmd="plugin:install-dependencies" if [[ $2 == "--core" ]]; then export PLUGIN_PATH="$PLUGIN_CORE_PATH" diff --git a/plugins/plugin/subcommands/uninstall b/plugins/plugin/subcommands/uninstall index ad9ebd2ec..064ee721e 100755 --- a/plugins/plugin/subcommands/uninstall +++ b/plugins/plugin/subcommands/uninstall @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/plugin/functions" plugin_uninstall_cmd() { - local desc="uninstalls plugin via command line" + declare desc="uninstalls plugin via command line" local cmd="plugin:uninstall" [[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable" local PLUGIN="$2" diff --git a/plugins/plugin/subcommands/update b/plugins/plugin/subcommands/update index 5ad974b82..19e82614a 100755 --- a/plugins/plugin/subcommands/update +++ b/plugins/plugin/subcommands/update @@ -2,7 +2,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x plugin_update_cmd() { - local desc="updates plugin to optional committish and calls update plugin trigger via command line" + declare desc="updates plugin to optional committish and calls update plugin trigger via command line" local cmd="plugin:update" if [[ -n "$2" ]]; then local PLUGIN="$2" diff --git a/plugins/proxy/functions b/plugins/proxy/functions index 931fb607c..5f3dce1b6 100755 --- a/plugins/proxy/functions +++ b/plugins/proxy/functions @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" is_app_proxy_enabled() { - local desc="return true if proxy is enabled; otherwise return false" + declare desc="return true if proxy is enabled; otherwise return false" local APP="$1"; verify_app_name "$APP" local APP_PROXY_ENABLED=true @@ -16,7 +16,7 @@ is_app_proxy_enabled() { } get_app_proxy_type() { - local desc="return app proxy type" + declare desc="return app proxy type" local APP="$1"; verify_app_name "$APP" local APP_PROXY_TYPE="nginx" diff --git a/plugins/proxy/subcommands/default b/plugins/proxy/subcommands/default index d7e8b30f7..cd913904c 100755 --- a/plugins/proxy/subcommands/default +++ b/plugins/proxy/subcommands/default @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions" proxy_main_cmd() { - local desc="displays app proxy implementation via command line" + declare desc="displays app proxy implementation via command line" local cmd="proxy" local ALL_APPS=$(dokku_apps) if [[ -n "$2" ]]; then diff --git a/plugins/proxy/subcommands/disable b/plugins/proxy/subcommands/disable index e54b3c46d..504b6f6af 100755 --- a/plugins/proxy/subcommands/disable +++ b/plugins/proxy/subcommands/disable @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions" proxy_disable_cmd() { - local desc="disable proxy for app via command line" + declare desc="disable proxy for app via command line" local cmd="proxy:disable" [[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$1"; verify_app_name "$APP" diff --git a/plugins/proxy/subcommands/enable b/plugins/proxy/subcommands/enable index 96b1a2e38..0aa20f2b4 100755 --- a/plugins/proxy/subcommands/enable +++ b/plugins/proxy/subcommands/enable @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions" proxy_enable_cmd() { - local desc="enable proxy for app via command line" + declare desc="enable proxy for app via command line" local cmd="proxy:enable" [[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$1"; verify_app_name "$APP" diff --git a/plugins/proxy/subcommands/set b/plugins/proxy/subcommands/set index c999a1b1e..ac08a58ec 100755 --- a/plugins/proxy/subcommands/set +++ b/plugins/proxy/subcommands/set @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" proxy_set_cmd() { - local desc="enable proxy for app via command line" + declare desc="enable proxy for app via command line" local cmd="proxy:set" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" diff --git a/plugins/ps/functions b/plugins/ps/functions index f5805c854..930ba5ea3 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" print_dokku_scale_file() { - local desc="prints contents of DOKKU_SCALE file" + declare desc="prints contents of DOKKU_SCALE file" local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" while read -r line || [[ -n "$line" ]]; do dokku_log_info2_quiet "$line" @@ -11,7 +11,7 @@ print_dokku_scale_file() { } extract_procfile() { - local desc="extracts procfile from app image" + declare desc="extracts procfile from app image" local APP="$1" local IMAGE_TAG="$(get_running_image_tag "$APP")" local IMAGE="$(get_app_image_name "$APP" "$IMAGE_TAG")" @@ -27,7 +27,7 @@ extract_procfile() { } remove_procfile() { - local desc="removes DOKKU_PROCFILE" + declare desc="removes DOKKU_PROCFILE" local APP="$1"; local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" if [[ -f "$DOKKU_PROCFILE" ]]; then rm -f "$DOKKU_PROCFILE" @@ -35,7 +35,7 @@ remove_procfile() { } generate_scale_file() { - local desc="generates DOKKU_SCALE file" + declare desc="generates DOKKU_SCALE file" local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG"); local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" verify_app_name "$APP" @@ -68,7 +68,7 @@ generate_scale_file() { } set_scale() { - local desc="sets app proc type scaling" + declare desc="sets app proc type scaling" local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" shift 1 local SCALE_SETTINGS=("$@") @@ -86,7 +86,7 @@ set_scale() { } ps_start() { - local desc="starts app" + declare desc="starts app" local APP="$1"; verify_app_name "$APP" local IMAGE_TAG=$(get_running_image_tag "$APP"); @@ -100,7 +100,7 @@ ps_start() { } ps_stop() { - local desc="stops app" + declare desc="stops app" local APP="$1"; verify_app_name "$APP" local DOKKU_APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids "$APP") @@ -117,14 +117,14 @@ ps_stop() { } ps_rebuild() { - local desc="rebuilds app from base image" + declare desc="rebuilds app from base image" local APP="$1"; verify_app_name "$APP" plugn trigger receive-app "$APP" } ps_restart() { - local desc="restarts app" + declare desc="restarts app" local APP="$1"; verify_app_name "$APP" local IMAGE_TAG=$(get_running_image_tag "$APP") @@ -134,7 +134,7 @@ ps_restart() { } ps_scale() { - local desc="sets app scaling config according arguments; otherwise according to DOKKU_SCALE file" + declare desc="sets app scaling config according arguments; otherwise according to DOKKU_SCALE file" local APP="$1"; verify_app_name "$APP" local IMAGE_TAG=$(get_running_image_tag "$APP") local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" diff --git a/plugins/ps/post-deploy b/plugins/ps/post-deploy index 6024be3bb..f66170f6f 100755 --- a/plugins/ps/post-deploy +++ b/plugins/ps/post-deploy @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_post_deploy() { - local desc="ps post-deploy plugin trigger" + declare desc="ps post-deploy plugin trigger" local trigger="ps_post_deploy" local APP="$1" diff --git a/plugins/ps/post-stop b/plugins/ps/post-stop index 8c0776a1e..e3e22f695 100755 --- a/plugins/ps/post-stop +++ b/plugins/ps/post-stop @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_post_stop() { - local desc="ps post-stop plugin trigger" + declare desc="ps post-stop plugin trigger" local trigger="ps_post_stop" local APP="$1" diff --git a/plugins/ps/pre-deploy b/plugins/ps/pre-deploy index a6f56a493..92112d8ec 100755 --- a/plugins/ps/pre-deploy +++ b/plugins/ps/pre-deploy @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_pre_deploy() { - local desc="ps pre-deploy plugin trigger" + declare desc="ps pre-deploy plugin trigger" local trigger="ps_pre_deploy" local APP="$1" diff --git a/plugins/ps/subcommands/default b/plugins/ps/subcommands/default index 89831e417..46dec800a 100755 --- a/plugins/ps/subcommands/default +++ b/plugins/ps/subcommands/default @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" ps_main_cmd() { - local desc="shows running processes in all running app containers" + declare desc="shows running processes in all running app containers" local cmd="ps" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" diff --git a/plugins/ps/subcommands/rebuild b/plugins/ps/subcommands/rebuild index 06ecb8190..e564be45a 100755 --- a/plugins/ps/subcommands/rebuild +++ b/plugins/ps/subcommands/rebuild @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_rebuild_cmd() { - local desc="rebuilds app via command line" + declare desc="rebuilds app via command line" local cmd="ps:rebuild" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" ps_rebuild "$2" diff --git a/plugins/ps/subcommands/rebuildall b/plugins/ps/subcommands/rebuildall index ba00b1d92..7a903b3f0 100755 --- a/plugins/ps/subcommands/rebuildall +++ b/plugins/ps/subcommands/rebuildall @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_rebuildall_cmd() { - local desc="rebuilds all deployed apps via command line" + declare desc="rebuilds all deployed apps via command line" local cmd="ps:rebuildall" for app in $(dokku_apps); do is_deployed "$app" && ps_rebuild "$app" diff --git a/plugins/ps/subcommands/restart b/plugins/ps/subcommands/restart index 0498f76cc..cf41a64b4 100755 --- a/plugins/ps/subcommands/restart +++ b/plugins/ps/subcommands/restart @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_restart_cmd() { - local desc="restarts app via command line" + declare desc="restarts app via command line" local cmd="ps:restart" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" ps_restart "$2" diff --git a/plugins/ps/subcommands/restartall b/plugins/ps/subcommands/restartall index afe4e4f07..bfdeed29a 100755 --- a/plugins/ps/subcommands/restartall +++ b/plugins/ps/subcommands/restartall @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_restartall_cmd() { - local desc="restarts all apps via command line" + declare desc="restarts all apps via command line" local cmd="ps:restartall" for app in $(dokku_apps); do ps_restart "$app" diff --git a/plugins/ps/subcommands/restore b/plugins/ps/subcommands/restore index 8ccbba9ad..0b7b83729 100755 --- a/plugins/ps/subcommands/restore +++ b/plugins/ps/subcommands/restore @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_restore_cmd() { - local desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line" + declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line" local cmd="ps:restore" for app in $(dokku_apps); do local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true) diff --git a/plugins/ps/subcommands/scale b/plugins/ps/subcommands/scale index c285c5364..3e4993200 100755 --- a/plugins/ps/subcommands/scale +++ b/plugins/ps/subcommands/scale @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_scale_cmd() { - local desc="sets app scaling config via command line" + declare desc="sets app scaling config via command line" local cmd="ps:scale" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" shift 1 diff --git a/plugins/ps/subcommands/start b/plugins/ps/subcommands/start index 67c18235b..4f3e298d7 100755 --- a/plugins/ps/subcommands/start +++ b/plugins/ps/subcommands/start @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_start_cmd() { - local desc="starts app via command line" + declare desc="starts app via command line" local cmd="ps:start" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" ps_start "$2" diff --git a/plugins/ps/subcommands/stop b/plugins/ps/subcommands/stop index 9088415eb..a24b75559 100755 --- a/plugins/ps/subcommands/stop +++ b/plugins/ps/subcommands/stop @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" ps_stop_cmd() { - local desc="stops app via command line" + declare desc="stops app via command line" local cmd="ps:stop" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" ps_stop "$2" diff --git a/plugins/shell/subcommands/default b/plugins/shell/subcommands/default index f73117bb0..73dded250 100755 --- a/plugins/shell/subcommands/default +++ b/plugins/shell/subcommands/default @@ -2,7 +2,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x shell_cmd() { - local desc="dokku shell interpreter via command line" + declare desc="dokku shell interpreter via command line" local cmd="shell" local INPUTRC="$PLUGIN_ROOT/inputrc" local HISTFILE=~/.dokku_history diff --git a/plugins/storage/functions b/plugins/storage/functions index bd600a208..767059f13 100755 --- a/plugins/storage/functions +++ b/plugins/storage/functions @@ -3,19 +3,19 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" verify_paths() { - local desc="verifies storage paths" + declare desc="verifies storage paths" echo "$1" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths divided by colon." } check_if_path_exists() { - local desc="checks if path exists" + declare desc="checks if path exists" local -r passed_path=$1 local -r phase_file_path=$2 [[ -r "$phase_file_path" ]] && grep -qe "^-v $passed_path" "$phase_file_path" } get_bind_mounts() { - local desc="strips docker options and prints mounts" + declare desc="strips docker options and prints mounts" local -r phase_file_path=$1 [[ -r "$phase_file_path" ]] && sed -e '/^-v/!d' -e 's/^-v/ /' < "$phase_file_path" } diff --git a/plugins/storage/subcommands/list b/plugins/storage/subcommands/list index 7cf67244e..ecaab29b0 100755 --- a/plugins/storage/subcommands/list +++ b/plugins/storage/subcommands/list @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions" storage_list_cmd() { - local desc="List all bound mounts" + declare desc="List all bound mounts" local cmd="storage:list" local passed_phases="deploy" [[ ! $2 ]] && dokku_log_fail "storage:list requires an app to list." diff --git a/plugins/storage/subcommands/mount b/plugins/storage/subcommands/mount index 7eb4645df..b82a550cb 100755 --- a/plugins/storage/subcommands/mount +++ b/plugins/storage/subcommands/mount @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions" storage_mount_cmd() { - local desc="Add bind-mount, redeploy app if running" + declare desc="Add bind-mount, redeploy app if running" local cmd="storage:mount" local passed_phases=(deploy run) [[ -z $3 || $4 ]] && dokku_log_fail "storage:mount requires an app and a two paths divided by colon." diff --git a/plugins/storage/subcommands/unmount b/plugins/storage/subcommands/unmount index 3007b27a9..d460386d5 100755 --- a/plugins/storage/subcommands/unmount +++ b/plugins/storage/subcommands/unmount @@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions" storage_unmount_cmd() { - local desc="Remove bind-mount, restart app if running" + declare desc="Remove bind-mount, restart app if running" local cmd="storage:unmount" local passed_phases=(deploy run) [[ -z $3 || $4 ]] && dokku_log_fail "storage:unmount requires an app and a two paths divided by colon." diff --git a/plugins/tags/functions b/plugins/tags/functions index 3cda584bf..cd244c105 100755 --- a/plugins/tags/functions +++ b/plugins/tags/functions @@ -3,6 +3,6 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" tag_image() { - local desc="convenience method for docker tag interface" + declare desc="convenience method for docker tag interface" docker tag -f "$1" "$2" } diff --git a/plugins/tags/subcommands/create b/plugins/tags/subcommands/create index f8104fd7f..00adbea58 100755 --- a/plugins/tags/subcommands/create +++ b/plugins/tags/subcommands/create @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/tags/functions" tags_create_cmd() { - local desc="creates an images tag for app via command line" + declare desc="creates an images tag for app via command line" local cmd="tags:create" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$2"; local IMAGE_TAG="$3"; local IMAGE_REPO=$(get_app_image_repo "$APP") diff --git a/plugins/tags/subcommands/default b/plugins/tags/subcommands/default index a7b4bb200..de16fb926 100755 --- a/plugins/tags/subcommands/default +++ b/plugins/tags/subcommands/default @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/tags/functions" tags_main_cmd() { - local desc="shows docker images tags for app via command line" + declare desc="shows docker images tags for app via command line" local cmd="tags" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$2"; local IMAGE_REPO=$(get_app_image_repo "$APP") diff --git a/plugins/tags/subcommands/deploy b/plugins/tags/subcommands/deploy index 67906dc41..ebd6ec1ac 100755 --- a/plugins/tags/subcommands/deploy +++ b/plugins/tags/subcommands/deploy @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/tags/functions" tags_deploy_cmd() { - local desc="deploys an app with a given tagged image via command line" + declare desc="deploys an app with a given tagged image via command line" local cmd="tags:deploy" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$2"; local IMAGE_TAG="$3" diff --git a/plugins/tags/subcommands/destroy b/plugins/tags/subcommands/destroy index 6ab3653a5..4fec517ab 100755 --- a/plugins/tags/subcommands/destroy +++ b/plugins/tags/subcommands/destroy @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/tags/functions" tags_destroy_cmd() { - local desc="destroys an app image tag via command line" + declare desc="destroys an app image tag via command line" local cmd="tags:destroy" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" local APP="$2"; local IMAGE_TAG="$3"; local IMAGE_REPO=$(get_app_image_repo "$APP") diff --git a/plugins/tar/receive-app b/plugins/tar/receive-app index 0a2348d72..16f6dd5ca 100755 --- a/plugins/tar/receive-app +++ b/plugins/tar/receive-app @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" tar_receive_app() { - local desc="tar receive-app plugin trigger" + declare desc="tar receive-app plugin trigger" local trigger="tar_receive_app" local APP="$1"; local REV="$2" diff --git a/plugins/tar/subcommands/build b/plugins/tar/subcommands/build index c5f479aa6..ecb0b96e0 100755 --- a/plugins/tar/subcommands/build +++ b/plugins/tar/subcommands/build @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" tar_build_cmd() { - local desc="calls tar:build-locked via command line" + declare desc="calls tar:build-locked via command line" local cmd="tar:build" verify_app_name "$2" diff --git a/plugins/tar/subcommands/build-locked b/plugins/tar/subcommands/build-locked index 07bc1e1d7..63b366b8f 100755 --- a/plugins/tar/subcommands/build-locked +++ b/plugins/tar/subcommands/build-locked @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" tar_build_locked_cmd() { - local desc="builds apps from tarball via command line" + declare desc="builds apps from tarball via command line" local cmd="tar:build-locked" local APP="$2" diff --git a/plugins/tar/subcommands/from b/plugins/tar/subcommands/from index 61477098a..c51b74fbf 100755 --- a/plugins/tar/subcommands/from +++ b/plugins/tar/subcommands/from @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" tar_from_cmd() { - local desc="deploys app from tarball at URL via command line" + declare desc="deploys app from tarball at URL via command line" local cmd="tar:from" verify_app_name "$2" local APP=$2 diff --git a/plugins/tar/subcommands/in b/plugins/tar/subcommands/in index f080e1076..7bbdb5f87 100755 --- a/plugins/tar/subcommands/in +++ b/plugins/tar/subcommands/in @@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" tar_in_cmd() { - local desc="deploys app from tarball on STDIN via command line" + declare desc="deploys app from tarball on STDIN via command line" local cmd="tar:in" local APP="$2"