From 238ace05dc0ffd9567e2c6f1c0b0b1bad3178d63 Mon Sep 17 00:00:00 2001 From: yiciheng Date: Mon, 31 Aug 2026 14:31:47 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E9=AA=8C=E8=AF=81=20workspace=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=A3=80=E5=87=BA=E4=B8=8E=20docker=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index dab3b48..01108f2 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -5,15 +5,23 @@ jobs: runs-on: ubuntu-latest container: image: docker:24.0-cli - options: -v /opt/freedom:/opt/freedom + options: -v /opt/freedom:/opt/freedom --add-host=host.docker.internal:host-gateway steps: - name: Verify run: | + echo "=== pwd & 工作目录 ===" + pwd; ls -la + echo "=== workspace 是否被自动检出 ===" + ls -la /workspace/yiciheng/ci-test 2>&1 echo "=== /opt/freedom ===" ls -la /opt/freedom echo "=== sock ===" test -S /var/run/docker.sock && echo SOCK_OK || echo SOCK_NO - echo "=== write test ===" - echo hello > /opt/freedom/.ci_write_test && cat /opt/freedom/.ci_write_test && rm /opt/freedom/.ci_write_test && echo WRITE_OK + echo "=== host.docker.internal 解析 ===" + getent hosts host.docker.internal || echo NOT_RESOLVED + wget -q -T 3 -O /dev/null http://host.docker.internal:3000/api/v1/version && echo GITEA_OK || echo GITEA_FAIL + echo "=== docker build 冒烟(容器内路径 -> 宿主 daemon)===" + mkdir -p /tmp/bt && printf 'FROM alpine:3\nRUN echo build-ok\n' > /tmp/bt/Dockerfile + docker build -t ci-smoke:latest /tmp/bt echo "=== compose services ===" cd /opt/freedom/deploy && docker compose config --services