Files
dokku/plugins/nginx-vhosts/core-post-deploy
Jose Diaz-Gonzalez 61a306664f refactor: move domain manipulation into triggers
This allows other plugins to avoid understanding the underlying details of how domains might be integrated with.
2020-05-06 00:16:51 -04:00

25 lines
690 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/nginx-vhosts/functions"
trigger-nginx-vhosts-core-post-deploy() {
declare desc="nginx-vhosts core-post-deploy plugin trigger"
declare trigger="nginx_core_post_deploy"
declare APP="$1"
local HAS_NETWORK_CONFIG
if [[ "$(plugn trigger proxy-type "$APP")" != "nginx" ]]; then
return
fi
HAS_NETWORK_CONFIG="$(plugn trigger network-config-exists "$APP")"
if [[ "$HAS_NETWORK_CONFIG" == "true" ]]; then
plugn trigger domains-setup "$APP"
nginx_build_config "$APP"
fi
}
trigger-nginx-vhosts-core-post-deploy "$@"