From 5fe450973bcee52b15497267fc661bae3832367a Mon Sep 17 00:00:00 2001 From: wonder Date: Tue, 3 Nov 2026 13:29:14 +0800 Subject: [PATCH] =?UTF-8?q?CI=20=E9=AA=8C=E8=AF=81=E6=94=B9=E4=B8=BA=20doc?= =?UTF-8?q?ker=20exec=20=E5=AE=B9=E5=99=A8=E5=86=85=E8=87=AA=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runner 任务运行在容器中,宿主机端口映射不在任务回环上, 127.0.0.1:8080 必然拒连;改为在 resume-site 容器内 wget + 文件大小校验 --- .gitea/workflows/deploy.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a7c6c90..e61eace 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -39,19 +39,14 @@ jobs: - name: Verify Deployment (页面 + PDF) run: | - # 等待容器就绪(最多 30s) - for i in $(seq 1 10); do - curl -fsS http://127.0.0.1:8080/ > /dev/null 2>&1 && break - echo "waiting for container... ($i)" - sleep 3 - done - curl -fsS http://127.0.0.1:8080/ > /dev/null + # 在目标容器内自检(runner 任务跑在容器中,127.0.0.1 非宿主机回环) + sleep 2 + docker exec resume-site wget -q -O /dev/null http://127.0.0.1/ + echo "PAGE OK: /" for f in private-dev private-support soe-dev soe-support; do - ct=$(curl -fsS -o /dev/null -w '%{content_type}' http://127.0.0.1:8080/pdf/$f.pdf) - case "$ct" in - application/pdf*) echo "PDF OK: $f ($ct)" ;; - *) echo "PDF BAD: $f (content-type: $ct)"; exit 1 ;; - esac + docker exec resume-site wget -q -O /dev/null http://127.0.0.1/pdf/$f.pdf + docker exec resume-site sh -c "test \$(stat -c %s /usr/share/nginx/html/pdf/$f.pdf) -gt 20000" + echo "PDF OK: $f" done - name: Cleanup Dangling Images