subcommand restructure and bashstyle refactor. closes #1579
This commit is contained in:
committed by
Michael Hobbs
parent
76e27f0333
commit
89f289b433
@@ -1,21 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " nginx:build-config nginx:access-logs nginx:error-logs 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
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||
|
||||
case "$1" in
|
||||
nginx:build-config)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
nginx_build_config "$2"
|
||||
;;
|
||||
|
||||
nginx:access-logs|nginx:error-logs)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
nginx_logs "$@"
|
||||
;;
|
||||
|
||||
help | nginx:help)
|
||||
cat<<EOF
|
||||
nginx:build-config <app>, (Re)builds nginx config for given app
|
||||
|
||||
@@ -110,6 +110,7 @@ validate_ssl_domains() {
|
||||
}
|
||||
|
||||
get_custom_nginx_template() {
|
||||
local 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")"
|
||||
|
||||
14
plugins/nginx-vhosts/subcommands/access-logs
Executable file
14
plugins/nginx-vhosts/subcommands/access-logs
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/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_logs_cmd() {
|
||||
local 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 "$@"
|
||||
}
|
||||
|
||||
nginx_logs_cmd "$@"
|
||||
14
plugins/nginx-vhosts/subcommands/build-config
Executable file
14
plugins/nginx-vhosts/subcommands/build-config
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/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_build_config_cmd() {
|
||||
local 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"
|
||||
}
|
||||
|
||||
nginx_build_config_cmd "$@"
|
||||
1
plugins/nginx-vhosts/subcommands/error-logs
Symbolic link
1
plugins/nginx-vhosts/subcommands/error-logs
Symbolic link
@@ -0,0 +1 @@
|
||||
access-logs
|
||||
Reference in New Issue
Block a user