diff --git a/backend/app/services/ci_service.py b/backend/app/services/ci_service.py index 47a7bca..82e22f5 100644 --- a/backend/app/services/ci_service.py +++ b/backend/app/services/ci_service.py @@ -432,16 +432,16 @@ class CIService: logger.info(f"🔄 Updating repo at {target_dir}") try: # git fetch --all - subprocess.run(["git", "fetch", "--all"], cwd=target_dir, check=True) + subprocess.run(["git", "fetch", "-q", "--all"], cwd=target_dir, check=True) if pr_number: # Fetch PR ref specifically from base repo: refs/pull/ID/head logger.info(f"📥 Fetching PR ref: refs/pull/{pr_number}/head") - subprocess.run(["git", "fetch", "origin", f"refs/pull/{pr_number}/head"], cwd=target_dir, check=True) - subprocess.run(["git", "checkout", "FETCH_HEAD"], cwd=target_dir, check=True) + subprocess.run(["git", "fetch", "-q", "origin", f"refs/pull/{pr_number}/head"], cwd=target_dir, check=True) + subprocess.run(["git", "checkout", "-q", "FETCH_HEAD"], cwd=target_dir, check=True) else: # git checkout branch - subprocess.run(["git", "checkout", branch], cwd=target_dir, check=True) + subprocess.run(["git", "checkout", "-q", branch], cwd=target_dir, check=True) # git reset --hard origin/branch subprocess.run(["git", "reset", "--hard", f"origin/{branch}"], cwd=target_dir, check=True) except Exception as e: @@ -457,10 +457,10 @@ class CIService: if pr_number: logger.info(f"📥 Fetching PR ref: refs/pull/{pr_number}/head") - subprocess.run(["git", "fetch", "origin", f"refs/pull/{pr_number}/head"], cwd=target_dir, check=True) - subprocess.run(["git", "checkout", "FETCH_HEAD"], cwd=target_dir, check=True) + subprocess.run(["git", "fetch", "-q", "origin", f"refs/pull/{pr_number}/head"], cwd=target_dir, check=True) + subprocess.run(["git", "checkout", "-q", "FETCH_HEAD"], cwd=target_dir, check=True) else: - subprocess.run(["git", "checkout", branch], cwd=target_dir, check=True) + subprocess.run(["git", "checkout", "-q", branch], cwd=target_dir, check=True) except Exception as e: logger.error(f"Git clone failed: {e}") raise e diff --git a/docker-compose.yml b/docker-compose.yml index 97ac304..c3c47f5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" volumes: - - ./backend/app:/app/app:ro # 挂载代码目录,修改后自动生效 + - ./backend/app:/app/app:ro # 挂载代码目录,修改后自动生效 - backend_uploads:/app/uploads - chroma_data:/app/data/vector_db - /var/run/docker.sock:/var/run/docker.sock # 沙箱执行必须 @@ -65,7 +65,7 @@ services: redis: condition: service_healthy # 开发模式:启用 --reload 热重载 - command: sh -c ".venv/bin/alembic upgrade head && .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload" + command: sh -c ".venv/bin/alembic upgrade head && .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload --reload-exclude 'data/*'" networks: - deepaudit-network