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