subcommand restructure and bashstyle refactor. closes #1579

This commit is contained in:
Michael S. Hobbs
2016-03-01 13:26:35 -08:00
committed by Michael Hobbs
parent 76e27f0333
commit 89f289b433
105 changed files with 1969 additions and 1306 deletions

View File

@@ -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

View File

@@ -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")"

View 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 "$@"

View 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 "$@"

View File

@@ -0,0 +1 @@
access-logs