use declare for description variable
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user