Files
dokku/plugins/nginx-vhosts/core-post-deploy
Jose Diaz-Gonzalez 17814d4847 refactor: only extract the nginx.conf.sigil from the source code and not an app path
The previous method was a bit more difficult for users to interact with as they needed to ensure the file was at a certain path in the built image. This change divorces the file from the built artifact, better aligning the nginx.conf.sigil handling with the rest of Dokku's monorepo support.

A side effect of this is now building proxy configurations does not require access to the built image.

Closes #5207
2022-11-23 19:32:53 -05:00

28 lines
911 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"
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/upcoming.nginx.conf.sigil" ]]; then
mv "${DOKKU_LIB_ROOT}/data/nginx-vhosts/upcoming.nginx.conf.sigil" "${DOKKU_LIB_ROOT}/data/nginx-vhosts/nginx.conf.sigil"
fi
fi
}
trigger-nginx-vhosts-core-post-deploy "$@"