Due to how the nginx proxy implementation works, if an app has either many process types or many containers for a process type other than web, it is possible to see downtime on the web process due to the old web containers rotating out _before_ we reload the nginx config. The correct fix would be to use some sort of dns-based resolution for the nginx config, but pending that change, we reload nginx twice now - ugh - to avoid this.
25 lines
693 B
Bash
Executable File
25 lines
693 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-scheduler-post-deploy-process() {
|
|
declare desc="nginx-vhosts scheduler-post-deploy-process plugin trigger"
|
|
declare trigger="scheduler-post-deploy-process"
|
|
declare APP="$1" PROCESS_TYPE="$2"
|
|
|
|
if [[ "$PROCESS_TYPE" != "web" ]]; then
|
|
return
|
|
fi
|
|
|
|
if [[ "$(plugn trigger proxy-type "$APP")" != "nginx" ]]; then
|
|
return
|
|
fi
|
|
|
|
dokku_log_info1 "Triggering early nginx proxy rebuild"
|
|
plugn trigger proxy-build-config "$APP"
|
|
}
|
|
|
|
trigger-nginx-vhosts-scheduler-post-deploy-process "$@"
|