fix: ensure we cleanup extracted files prior to next deployment

This commit is contained in:
Jose Diaz-Gonzalez
2023-08-27 19:20:45 -04:00
parent 7bd202a178
commit fecb9e0472
3 changed files with 6 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ fn-openresty-vhosts-copy-from-image() {
declare APP="$1" IMAGE_NAME="$2" CONF_PATH="$3"
mkdir -p "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP"
rm -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes."*
find "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/" -maxdepth 1 -name 'openresty-http-includes.*' -delete
copy_dir_from_image "$IMAGE_NAME" "$CONF_PATH" "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes.$DOKKU_PID" || true
if [[ ! -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes.$DOKKU_PID" ]]; then
touch "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes.$DOKKU_PID.missing"
@@ -31,7 +31,7 @@ fn-openresty-vhosts-copy-from-directory() {
return
fi
rm -f "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes."*
find "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/" -maxdepth 1 -name 'openresty-http-includes.*' -delete
mkdir p "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes.$DOKKU_PID/"
cp -f "$CONF_PATH"/* "${DOKKU_LIB_ROOT}/data/openresty-vhosts/app-$APP/openresty-http-includes.$DOKKU_PID/"
popd &>/dev/null || pushd "/tmp" >/dev/null