feat: scope the custom config to the current DOKKU_PID

This commit is contained in:
Jose Diaz-Gonzalez
2022-11-23 19:43:29 -05:00
parent b166db90e6
commit 140c1e4d4c
3 changed files with 6 additions and 6 deletions

View File

@@ -18,8 +18,8 @@ trigger-nginx-vhosts-core-post-deploy() {
if [[ "$HAS_NETWORK_CONFIG" == "true" ]]; then
plugn trigger domains-setup "$APP"
nginx_build_config "$APP"
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-upcoming.nginx.conf.sigil" ]]; then
mv "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-upcoming.nginx.conf.sigil" "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-nginx.conf.sigil"
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-$DOKKU_PID.nginx.conf.sigil" ]]; then
mv "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-$DOKKU_PID.nginx.conf.sigil" "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-nginx.conf.sigil"
fi
fi
}

View File

@@ -20,8 +20,8 @@ trigger-nginx-vhosts-core-post-extract() {
return
fi
rm -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-upcoming.nginx.conf.sigil"
cp -f "$CONF_SIGIL_PATH" "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-upcoming.nginx.conf.sigil"
rm -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-$DOKKU_PID.nginx.conf.sigil"
cp -f "$CONF_SIGIL_PATH" "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-$DOKKU_PID.nginx.conf.sigil"
popd &>/dev/null || pushd "/tmp" >/dev/null
}

View File

@@ -190,8 +190,8 @@ get_custom_nginx_template() {
return
fi
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-upcoming.nginx.conf.sigil" ]]; then
cp "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-upcoming.nginx.conf.sigil" "$DESTINATION_FILE"
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-$DOKKU_PID.nginx.conf.sigil" ]]; then
cp "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-$DOKKU_PID.nginx.conf.sigil" "$DESTINATION_FILE"
elif [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-nginx.conf.sigil" ]]; then
cp "${DOKKU_LIB_ROOT}/data/nginx-vhosts/$APP-nginx.conf.sigil" "$DESTINATION_FILE"
fi