Files
dokku/plugins/nginx-vhosts/subcommands/build-config
2020-02-10 01:40:30 -05:00

25 lines
720 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
cmd-nginx-build-config() {
declare desc="build nginx config to proxy app containers from command line"
declare cmd="nginx:build-config"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
local PROXY_APP_TYPE
PROXY_APP_TYPE="$(get_app_proxy_type "$APP")"
if [[ "$PROXY_APP_TYPE" == "nginx" ]]; then
plugn trigger proxy-build-config "$APP"
else
dokku_log_fail "Configured proxy for ${APP} is ${PROXY_APP_TYPE}"
fi
}
cmd-nginx-build-config "$@"