mirror of
https://github.com/dokku/dokku.git
synced 2025-12-16 12:07:45 +01:00
This is more consistent with app setup, at the cost of making it so developers must disable domains manually afterwards.
34 lines
1.3 KiB
Bash
Executable File
34 lines
1.3 KiB
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-proxy-build-config() {
|
|
declare desc="build nginx config to proxy app containers from command line"
|
|
declare trigger="proxy-build-config"
|
|
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 network-build-config "$APP"
|
|
nginx_build_config "$APP"
|
|
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP/nginx.conf.sigil.$DOKKU_PID" ]]; then
|
|
mv "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP/nginx.conf.sigil.$DOKKU_PID" "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP/nginx.conf.sigil"
|
|
fi
|
|
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP/nginx.conf.sigil.$DOKKU_PID.missing" ]]; then
|
|
rm -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP/nginx.conf.sigil.$DOKKU_PID.missing"
|
|
rm -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP/nginx.conf.sigil"
|
|
fi
|
|
else
|
|
nginx_clear_config "$APP"
|
|
fi
|
|
}
|
|
|
|
trigger-nginx-vhosts-proxy-build-config "$@"
|