refactor: unify command declaration across codebase

This commit is contained in:
Jose Diaz-Gonzalez
2020-02-10 01:40:30 -05:00
parent b0abeb49dd
commit e67b96780d
108 changed files with 475 additions and 315 deletions

View File

@@ -6,9 +6,10 @@ set -eo pipefail
cmd-checks-report() {
declare desc="shows reports for an app"
local cmd="checks:report"
declare cmd="checks:report"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" INFO_FLAG="$2"
local INSTALLED_APPS=$(dokku_apps)
local APP="$2" INFO_FLAG="$3"
if [[ -n "$APP" ]] && [[ "$APP" == --* ]]; then
INFO_FLAG="$APP"

View File

@@ -6,11 +6,13 @@ source "$PLUGIN_AVAILABLE_PATH/checks/functions"
cmd-checks-default() {
declare desc="displays app zero-downtime checks status"
local cmd="checks"
declare cmd="checks"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
local APPS=$(dokku_apps)
if [[ -n "$1" ]]; then
local APPS="$1"
if [[ -n "$APP" ]]; then
local APPS="$APP"
fi
dokku_log_warn "Deprecated: Please use checks:report"

View File

@@ -6,9 +6,10 @@ source "$PLUGIN_AVAILABLE_PATH/checks/functions"
cmd-checks-disable() {
declare desc="disable zero-downtime checks for app/proctypes"
local cmd="checks:disable"
declare cmd="checks:disable"
[[ "$1" == "$cmd" ]] && shift 1
local APP="$1"
declare APP="$1"
verify_app_name "$APP"
local PROCTYPES="${2:-_all_}"
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)

View File

@@ -6,9 +6,10 @@ source "$PLUGIN_AVAILABLE_PATH/checks/functions"
cmd-checks-enable() {
declare desc="enable zero-downtime checks for app/proctypes"
local cmd="checks:enable"
declare cmd="checks:enable"
[[ "$1" == "$cmd" ]] && shift 1
local APP="$1"
declare APP="$1"
verify_app_name "$APP"
local PROCTYPES="${2:-_all_}"

View File

@@ -69,9 +69,10 @@ check_process() {
cmd-checks-run() {
declare desc="run zero-downtime checks for app/proctypes"
local cmd="checks:run"
declare cmd="checks:run"
[[ "$1" == "$cmd" ]] && shift 1
local APP="$1"
declare APP="$1"
verify_app_name "$APP"
local PROCTYPES="${2:-_all_}"

View File

@@ -6,9 +6,10 @@ source "$PLUGIN_AVAILABLE_PATH/checks/functions"
cmd-checks-skip() {
declare desc="skip zero-downtime checks for app/proctypes"
local cmd="checks:skip"
declare cmd="checks:skip"
[[ "$1" == "$cmd" ]] && shift 1
local APP="$1"
declare APP="$1"
verify_app_name "$APP"
local PROCTYPES="${2:-_all_}"
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)