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
This commit is contained in:
28
plugins/nginx-vhosts/core-post-extract
Executable file
28
plugins/nginx-vhosts/core-post-extract
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
trigger-nginx-vhosts-core-post-extract() {
|
||||
declare desc="nginx-vhosts post-extract plugin trigger"
|
||||
declare trigger="post-extract"
|
||||
declare APP="$1" SOURCECODE_WORK_DIR="$2"
|
||||
local CONF_SIGIL_PATH="$(fn-nginx-computed-nginx-conf-sigil-path "$APP")"
|
||||
|
||||
pushd "$TMP_WORK_DIR" >/dev/null
|
||||
|
||||
if [[ -z "$CONF_SIGIL_PATH" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -f "$CONF_SIGIL_PATH" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
rm -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/upcoming.nginx.conf.sigil"
|
||||
cp -f "$CONF_SIGIL_PATH" "${DOKKU_LIB_ROOT}/data/nginx-vhosts/upcoming.nginx.conf.sigil"
|
||||
popd &>/dev/null || pushd "/tmp" >/dev/null
|
||||
}
|
||||
|
||||
trigger-nginx-vhosts-core-post-extract "$@"
|
||||
Reference in New Issue
Block a user