Files
dokku/plugins/nginx-vhosts/core-post-deploy
Jose Diaz-Gonzalez 2fc3a09b41 Move post-deploy trigger to core-post-deploy. Refs #2367
This avoids issues where community plugins may break core commands because of issues in the command output.
2016-09-05 00:04:06 -04:00

26 lines
858 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/domains/functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
nginx_core_post_deploy() {
declare desc="nginx-vhosts core-post-deploy plugin trigger"
local trigger="nginx_core_post_deploy"
local APP="$1"
if [[ -f "$DOKKU_ROOT/$APP/IP.web.1" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT.web.1" ]]; then
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
dokku_log_info1 "VHOST support disabled. Skipping domains setup"
elif [[ ! -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
domains_setup "$APP"
fi
nginx_build_config "$APP"
fi
}
if [[ "$(get_app_proxy_type "$1")" == "nginx" ]]; then
nginx_core_post_deploy "$@"
fi