From 860ad35387e0151497123724070c2109b7f144ac Mon Sep 17 00:00:00 2001 From: xiaoquan <838115837@qq.com> Date: Wed, 10 Jun 2026 17:43:10 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20=E8=87=AA=E5=8A=A8=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=20Gitea=20=E4=BB=93=E5=BA=93=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 修改内容 - 尝试多个可能的 Gitea 仓库路径 - 如果都找不到,执行 find 命令搜索 - 输出搜索结果,方便确定正确路径 ## 目的 - 找到服务器上 Gitea 仓库的实际位置 - 根据输出确定正确路径 Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/deploy.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index cebcfde..cc7d350 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -16,10 +16,33 @@ jobs: - name: Prepare code run: | WORK_DIR="/tmp/rent-deploy" - # Gitea 仓库在宿主机的实际路径 - GITEA_REPO="/www/dk_project/dk_app/gitea/gitea_P4dS/gitea/gitea/repositories/xiaoquan/rent.git" echo "准备代码目录..." + echo "查找 Gitea 仓库路径..." + + # 查找可能的 Gitea 仓库路径 + POSSIBLE_PATHS=( + "/www/dk_project/dk_app/gitea/gitea_P4dS/data/gitea/repositories/xiaoquan/rent.git" + "/www/dk_project/dk_app/gitea/gitea_P4dS/gitea/data/git/repositories/xiaoquan/rent.git" + "/var/lib/docker/volumes/gitea_data/_data/git/repositories/xiaoquan/rent.git" + ) + + GITEA_REPO="" + for path in "${POSSIBLE_PATHS[@]}"; do + if [ -d "$path" ]; then + GITEA_REPO="$path" + echo "✅ 找到仓库: $path" + break + fi + done + + if [ -z "$GITEA_REPO" ]; then + echo "❌ 未找到 Gitea 仓库,尝试查找..." + find /www/dk_project/dk_app/gitea -name "rent.git" -type d 2>/dev/null || true + find /var/lib/docker/volumes -name "rent.git" -type d 2>/dev/null || true + echo "请检查上面的输出,找到正确的仓库路径" + exit 1 + fi if [ -d "$WORK_DIR/.git" ]; then echo "代码目录已存在,更新代码..."