From 2dda1bded4c38c9fe51ccf8e5eeb906cc7036067 Mon Sep 17 00:00:00 2001 From: niexiaorong Date: Fri, 30 Jan 2026 11:40:36 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E4=B8=8B=E8=BD=BD=E8=84=9A=E6=9C=AC):=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=E5=A4=B9=E6=94=B9=E6=88=90?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E6=96=87=E4=BB=B6,=20=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnginx=E9=83=A8=E7=BD=B2=E7=99=BD=E5=B1=8FBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-downloader/web-downloader.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web-downloader/web-downloader.sh b/web-downloader/web-downloader.sh index 4cb68b0..93b8f76 100755 --- a/web-downloader/web-downloader.sh +++ b/web-downloader/web-downloader.sh @@ -35,9 +35,15 @@ fi # Unzip unzip "${TEAMCITY_BUILD_NAME}-${TEAMCITY_TAG}.zip" -if [ -e "${NGINX_HTML_DIR_NAME}" ]; then - rm -rf "${NGINX_HTML_DIR_NAME}" + +# Clean up content inside the directory, but KEEP the directory itself +# to avoid breaking Nginx Docker mounts/handles. +if [ -d "${NGINX_HTML_DIR_NAME}" ]; then + rm -rf "${NGINX_HTML_DIR_NAME:?}"/* +else + mkdir -p "${NGINX_HTML_DIR_NAME}" fi + unzip "${TEAMCITY_BUILD_ZIP_NAME}" -d "${NGINX_HTML_DIR_NAME}" cp_override_files