重构为Monorepo:拆分xhs/xhh应用与core包并完成双服务部署改造

This commit is contained in:
2026-03-03 16:06:16 +08:00
parent ed7fbdd5c2
commit 2cbd6b28b2
84 changed files with 6332 additions and 7678 deletions
Vendored
+41 -14
View File
@@ -2,7 +2,10 @@ pipeline {
agent any
environment {
APP_NAME = 'social-mcp'
IMAGE_XHS = 'social-mcp-xhs'
IMAGE_XHH = 'social-mcp-xhh'
APP_XHS = 'mcp-xhs'
APP_XHH = 'mcp-xhh'
}
triggers {
@@ -16,33 +19,57 @@ pipeline {
}
}
stage('Build Docker Image') {
stage('Build Docker Images') {
steps {
sh "docker build --build-arg HTTP_PROXY=http://172.17.0.1:7897 --build-arg HTTPS_PROXY=http://172.17.0.1:7897 -t ${APP_NAME}:${BUILD_NUMBER} -t ${APP_NAME}:latest ."
sh "docker build --build-arg APP_NAME=xhs-mcp --build-arg HTTP_PROXY=http://172.17.0.1:7897 --build-arg HTTPS_PROXY=http://172.17.0.1:7897 -t ${IMAGE_XHS}:${BUILD_NUMBER} -t ${IMAGE_XHS}:latest ."
sh "docker build --build-arg APP_NAME=xhh-mcp --build-arg HTTP_PROXY=http://172.17.0.1:7897 --build-arg HTTPS_PROXY=http://172.17.0.1:7897 -t ${IMAGE_XHH}:${BUILD_NUMBER} -t ${IMAGE_XHH}:latest ."
}
}
stage('Deploy') {
steps {
sh """
docker stop ${APP_NAME} || true
docker rm ${APP_NAME} || true
mkdir -p /data/${APP_NAME}
chown 1001:1001 /data/${APP_NAME}
docker stop ${APP_XHS} || true
docker rm ${APP_XHS} || true
docker stop ${APP_XHH} || true
docker rm ${APP_XHH} || true
mkdir -p /data/${APP_XHS}
mkdir -p /data/${APP_XHH}
chown 1001:1001 /data/${APP_XHS}
chown 1001:1001 /data/${APP_XHH}
docker run -d \
--name ${APP_NAME} \
--name ${APP_XHS} \
--network nginx \
-p 3010:3000 \
-p 9527:9527 \
--shm-size=1g \
-v /data/${APP_NAME}:/home/appuser/.social-mcp \
-v /data/${APP_XHS}:/home/appuser/.social-mcp-xhs \
-e NODE_ENV=production \
-e HOST=0.0.0.0 \
-e PORT=3000 \
-e PORT=9527 \
-e HEADLESS=true \
-e COOKIE_DIR=/home/appuser/.social-mcp \
-e COOKIE_DIR=/home/appuser/.social-mcp-xhs \
-e APP_NAME=xhs-mcp \
-e ALLOW_REMOTE=yes-i-understand-the-risk \
--restart unless-stopped \
${APP_NAME}:latest
${IMAGE_XHS}:latest
docker run -d \
--name ${APP_XHH} \
--network nginx \
-p 9528:9528 \
--shm-size=1g \
-v /data/${APP_XHH}:/home/appuser/.social-mcp-xhh \
-e NODE_ENV=production \
-e HOST=0.0.0.0 \
-e PORT=9528 \
-e HEADLESS=true \
-e COOKIE_DIR=/home/appuser/.social-mcp-xhh \
-e APP_NAME=xhh-mcp \
-e ALLOW_REMOTE=yes-i-understand-the-risk \
--restart unless-stopped \
${IMAGE_XHH}:latest
"""
}
}
@@ -50,7 +77,7 @@ pipeline {
post {
success {
echo "Deployed ${APP_NAME} build #${BUILD_NUMBER} successfully"
echo "Deployed ${APP_XHS} and ${APP_XHH} build #${BUILD_NUMBER} successfully"
}
failure {
echo "Build #${BUILD_NUMBER} failed"