Jenkins部署的时候部署hxopx-kb-worker

This commit is contained in:
sophie committed 2026-05-28 10:40:36 +08:00
1 parent 2721b9d00b
commit 858fb91f41
4 files changed
+7 -6

No files matched your search

+2 -2
View File
@@ -62,8 +62,8 @@ services:
hxops-kb-worker:
image: ${BACKEND_IMAGE:-hxops-backend:local}
build:
context: ./backend
dockerfile: Dockerfile
context: .
dockerfile: backend/Dockerfile
args:
PYTHON_BASE_IMAGE: ${PYTHON_BASE_IMAGE:-python:3.12-slim-bookworm}
PIP_INDEX_URL: ${PIP_INDEX_URL:-https://mirrors.aliyun.com/pypi/simple}
+1 -1
View File
@@ -106,7 +106,7 @@ docker compose ps
预期:
- `hxops-backend` 为 `Up`
- `hxops-kb-worker` 为 `Up`
- `hxops-kb-worker` 为 `Up`(与 backend 共用镜像;Jenkins/`deploy_compose.sh` 在后端变更时会一并重建)
- `hxops-frontend` 为 `Up`
若启用了 `kb-redis` profile,则额外确认:
+1 -1
View File
@@ -86,7 +86,7 @@ hxops/
采用 **本地开发 -> Gitee -> Jenkins -> 服务器 `deploy_compose.sh`**:
1. **本地开发**: 改代码后 `git push` 到对应分支(`dev` / `test` / `prod` 等)。
2. **Jenkins**: 在目标机 `git fetch/checkout` 后执行 `scripts/deploy_compose.sh <env>`,按变更增量重建 `hxops-frontend` / `hxops-backend`,并跑 `flask db upgrade` 与健康检查。
2. **Jenkins**: 在目标机 `git fetch/checkout` 后执行 `scripts/deploy_compose.sh <env>`,按变更增量重建 `hxops-frontend` / `hxops-backend` / `hxops-kb-worker`(后端变更时 worker 与 backend 同镜像一并重建),并跑 `flask db upgrade` 与健康检查。
3. **环境配置**: 仓库根目录 `.env.shared` + `.env.dev|test|prod`(见 `docs/env_loading_priority.md`)。
## 5. 🗄️ 核心数据模型 (Database Models)
+3 -2
View File
@@ -141,12 +141,13 @@ if [[ "${FRONTEND_CHANGED}" == "true" ]]; then
services+=("hxops-frontend")
fi
if [[ "${BACKEND_CHANGED}" == "true" ]]; then
services+=("hxops-backend")
# 知识库清洗与 backend 共用镜像;仅重建 backend 时 worker 会继续跑旧容器/旧代码
services+=("hxops-backend" "hxops-kb-worker")
fi
# 如果只是部署配置变更(如 compose/env/脚本),但前后端代码未改,则两边都更新
if [[ ${#services[@]} -eq 0 && "${DEPLOY_CONFIG_CHANGED}" == "true" ]]; then
services=("hxops-frontend" "hxops-backend")
services=("hxops-frontend" "hxops-backend" "hxops-kb-worker")
fi
# 无变更则直接跳过,避免无意义重启