Added nginx default help function
This commit is contained in:
@@ -1,26 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help nginx:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help nginx:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | nginx:help)
|
help | nginx:help)
|
||||||
help_content_func () {
|
|
||||||
declare desc="return nginx plugin help content"
|
|
||||||
cat<<help_content
|
|
||||||
nginx, Interact with Dokku's Nginx proxy
|
|
||||||
nginx:build-config <app>, (Re)builds nginx config for given app
|
|
||||||
nginx:access-logs <app> [-t], Show the nginx access logs for an application (-t follows)
|
|
||||||
nginx:error-logs <app> [-t], Show the nginx error logs for an application (-t follows)
|
|
||||||
help_content
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $1 = "nginx:help" ]] ; then
|
if [[ $1 = "nginx:help" ]] ; then
|
||||||
echo -e 'Usage: dokku nginx[:COMMAND]'
|
help_formatted
|
||||||
echo ''
|
|
||||||
echo 'Interact with Dokku'"'"'s Nginx proxy.'
|
|
||||||
echo ''
|
|
||||||
echo 'Additional commands:'
|
|
||||||
help_content_func | sort | column -c2 -t -s,
|
|
||||||
else
|
else
|
||||||
help_content_func
|
help_content_func
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -6,6 +6,25 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||||
|
|
||||||
|
help_formatted (){
|
||||||
|
echo -e 'Usage: dokku nginx[:COMMAND]'
|
||||||
|
echo ''
|
||||||
|
echo 'Interact with Dokku'"'"'s Nginx proxy.'
|
||||||
|
echo ''
|
||||||
|
echo 'Additional commands:'
|
||||||
|
help_content_func | sort | column -c2 -t -s,
|
||||||
|
}
|
||||||
|
|
||||||
|
help_content_func () {
|
||||||
|
declare desc="return nginx plugin help content"
|
||||||
|
cat<<help_content
|
||||||
|
nginx, Interact with Dokku's Nginx proxy
|
||||||
|
nginx:build-config <app>, (Re)builds nginx config for given app
|
||||||
|
nginx:access-logs <app> [-t], Show the nginx access logs for an application (-t follows)
|
||||||
|
nginx:error-logs <app> [-t], Show the nginx error logs for an application (-t follows)
|
||||||
|
help_content
|
||||||
|
}
|
||||||
|
|
||||||
validate_nginx() {
|
validate_nginx() {
|
||||||
declare desc="validate entire nginx config"
|
declare desc="validate entire nginx config"
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
13
plugins/nginx-vhosts/subcommands/default
Normal file
13
plugins/nginx-vhosts/subcommands/default
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||||
|
|
||||||
|
nginx_main_cmd() {
|
||||||
|
declare desc="display nginx plugin help content"
|
||||||
|
local cmd="nginx"
|
||||||
|
help_formatted
|
||||||
|
}
|
||||||
|
|
||||||
|
nginx_main_cmd "$@"
|
||||||
Reference in New Issue
Block a user