From 438c0f4e019e32a7b9d673388a0f318138e4e52281c95b390fa2c92b84ebe25d Mon Sep 17 00:00:00 2001 From: Maoayo233 Date: Mon, 21 Sep 2026 23:47:45 +0800 Subject: [PATCH] fix(ci): mount the bare repo for the deploy clone's local remote The deploy clone fetches from /srv/gitea/git/repositories/... which the job container cannot see, so 'git fetch' failed with exit 128. Mount it read-only and whitelist it. --- deploy/runner/config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deploy/runner/config.yaml b/deploy/runner/config.yaml index 1f4a9f7..0c8391d 100644 --- a/deploy/runner/config.yaml +++ b/deploy/runner/config.yaml @@ -27,14 +27,19 @@ container: # * 宿主 docker CLI + compose 插件: 不依赖 job 镜像里带没带(宿主是 glibc, Ubuntu 镜像能用)。 options: >- --volume /home/ymy/deploy:/home/ymy/deploy + --volume /srv/gitea:/srv/gitea:ro --volume /usr/bin/docker:/usr/bin/docker:ro --volume /usr/libexec/docker/cli-plugins:/usr/libexec/docker/cli-plugins:ro # ★ options 里的 --volume 也会过这道白名单: 不在 valid_volumes 里的卷会被 # "[xxx] is not a valid volume, will be ignored" 丢弃。漏配时 job 容器里 # 看不到 /home/ymy/deploy, 第一步 `cd /home/ymy/deploy/tjhlp-gitea` 就失败 # (2026-09-21 实际踩到)。 + # ★ 部署克隆的 origin 是宿主本地裸库 /srv/gitea/...; job 容器里没有它, + # `git fetch` 会报 "does not appear to be a git repository"(同一天又踩到), + # 故把 /srv/gitea 只读挂进去。 valid_volumes: - /home/ymy/deploy + - /srv/gitea - /usr/bin/docker - /usr/libexec/docker/cli-plugins force_pull: false # 镜像本地已有就不再拉