2023-08-01 02:16:11 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
|
|
|
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions"
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
|
|
|
|
|
|
trigger-openresty-vhosts-core-post-deploy() {
|
|
|
|
|
declare desc="openresty-vhosts core-post-deploy plugin trigger"
|
|
|
|
|
declare trigger="core-post-deploy"
|
|
|
|
|
declare APP="$1"
|
|
|
|
|
local tls_internal
|
|
|
|
|
|
|
|
|
|
if [[ "$(plugn trigger proxy-type "$APP")" != "openresty" ]]; then
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dokku_log_info1 "Routing app via openresty"
|
|
|
|
|
if [[ -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes.$DOKKU_PID.missing" ]]; then
|
|
|
|
|
rm -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes.$DOKKU_PID.missing"
|
|
|
|
|
rm -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes"
|
|
|
|
|
fi
|
2023-10-22 22:25:15 -04:00
|
|
|
if [[ -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-location-includes.$DOKKU_PID.missing" ]]; then
|
|
|
|
|
rm -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-location-includes.$DOKKU_PID.missing"
|
|
|
|
|
rm -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-location-includes"
|
|
|
|
|
fi
|
2023-08-01 02:16:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trigger-openresty-vhosts-core-post-deploy "$@"
|