From 74e3f8f1f3386437c0d7a6d0c7e335bf993e56e3 Mon Sep 17 00:00:00 2001 From: xu Date: Wed, 17 Dec 2025 17:45:53 +0800 Subject: [PATCH] =?UTF-8?q?SZX-1339=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=EF=BC=8810.251.113.104=EF=BC=89Jenkins=20=E4=B8=8Ajava?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E5=BC=82=E5=B8=B8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkins/jenkins.config.2025-12-17 | 128 ++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 jenkins/jenkins.config.2025-12-17 diff --git a/jenkins/jenkins.config.2025-12-17 b/jenkins/jenkins.config.2025-12-17 new file mode 100644 index 00000000..5ede0463 --- /dev/null +++ b/jenkins/jenkins.config.2025-12-17 @@ -0,0 +1,128 @@ +#!/bin/sh + +## 强制 Jenkins 使用指定 Maven(避免命中 /usr/bin/mvn 的旧版本) +MAVEN_HOME=/usr/local/opt/maven3 +export MAVEN_HOME +export PATH="$MAVEN_HOME/bin:$PATH" + +BOE_SERVER_ALL=boe-server-all-1.1.24.jar +BOE_SERVER_ALL_ORIGIN=boe-server-all-2.0.0.jar + +START_ENV=prod + +cd ./servers/boe-server-all + +#mvn clean package -Dmaven.test.skip=true -P ${START_ENV} +mvn clean package -o -DskipTests -Dmaven.resources.plugin.version=3.1.0 -P ${START_ENV} + +rsync -avzlopg --delete --progress ./target/$BOE_SERVER_ALL root@10.251.113.95:/home/system/ +rsync -avzlopg --delete --progress ./target/$BOE_SERVER_ALL root@10.251.113.94:/home/system/ +rsync -avzlopg --delete --progress ./target/$BOE_SERVER_ALL root@10.251.113.93:/home/system/ +rsync -avzlopg --delete --progress ./target/$BOE_SERVER_ALL root@10.251.113.92:/home/system/ +rsync -avzlopg --delete --progress ./target/$BOE_SERVER_ALL root@10.251.113.91:/home/system/ +rsync -avzlopg --delete --progress ./target/$BOE_SERVER_ALL root@10.251.113.90:/home/system/ + + +ssh -T root@10.251.113.95< /home/system/nohup.out 2>&1 &\"" + + + + +system_pid_origin=$(ssh root@10.251.113.94 "ps -ef | grep ${BOE_SERVER_ALL_ORIGIN} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid_origin ]; then + ssh root@10.251.113.94 "kill -9 ${system_pid_origin}" +fi +system_pid=$(ssh root@10.251.113.94 "ps -ef | grep ${BOE_SERVER_ALL} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid ]; then + ssh root@10.251.113.94 "kill -9 ${system_pid}" +fi +ssh root@10.251.113.94 "su - www-data -c \"nohup java -Dspring.profiles.active=${START_ENV} -jar -Xms512m -Xmx1024m /home/system/${BOE_SERVER_ALL}> /home/system/nohup.out 2>&1 &\"" + + + + + +system_pid_origin=$(ssh root@10.251.113.93 "ps -ef | grep ${BOE_SERVER_ALL_ORIGIN} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid_origin ]; then + ssh root@10.251.113.93 "kill -9 ${system_pid_origin}" +fi +system_pid=$(ssh root@10.251.113.93 "ps -ef | grep ${BOE_SERVER_ALL} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid ]; then + ssh root@10.251.113.93 "kill -9 ${system_pid}" +fi +ssh root@10.251.113.93 "su - www-data -c \"nohup java -Dspring.profiles.active=${START_ENV} -jar -Xms512m -Xmx1024m /home/system/${BOE_SERVER_ALL}> /home/system/nohup.out 2>&1 &\"" + + + + + +system_pid_origin=$(ssh root@10.251.113.92 "ps -ef | grep ${BOE_SERVER_ALL_ORIGIN} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid_origin ]; then + ssh root@10.251.113.92 "kill -9 ${system_pid_origin}" +fi +system_pid=$(ssh root@10.251.113.92 "ps -ef | grep ${BOE_SERVER_ALL} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid ]; then + ssh root@10.251.113.92 "kill -9 ${system_pid}" +fi +ssh root@10.251.113.92 "su - www-data -c \"nohup java -Dspring.profiles.active=${START_ENV} -jar -Xms512m -Xmx1024m /home/system/${BOE_SERVER_ALL}> /home/system/nohup.out 2>&1 &\"" + + + + + +system_pid_origin=$(ssh root@10.251.113.91 "ps -ef | grep ${BOE_SERVER_ALL_ORIGIN} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid_origin ]; then + ssh root@10.251.113.91 "kill -9 ${system_pid_origin}" +fi +system_pid=$(ssh root@10.251.113.91 "ps -ef | grep ${BOE_SERVER_ALL} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid ]; then + ssh root@10.251.113.91 "kill -9 ${system_pid}" +fi +ssh root@10.251.113.91 "su - www-data -c \"nohup java -Dspring.profiles.active=${START_ENV} -jar -Xms512m -Xmx1024m /home/system/${BOE_SERVER_ALL}> /home/system/nohup.out 2>&1 &\"" + + + + + +system_pid_origin=$(ssh root@10.251.113.90 "ps -ef | grep ${BOE_SERVER_ALL_ORIGIN} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid_origin ]; then + ssh root@10.251.113.90 "kill -9 ${system_pid_origin}" +fi +system_pid=$(ssh root@10.251.113.90 "ps -ef | grep ${BOE_SERVER_ALL} | grep -v grep | awk '{print $2}'"| awk '{print $2}') +if [ -n $system_pid ]; then + ssh root@10.251.113.90 "kill -9 ${system_pid}" +fi +ssh root@10.251.113.90 "su - www-data -c \"nohup java -Dspring.profiles.active=${START_ENV} -jar -Xms512m -Xmx1024m /home/system/${BOE_SERVER_ALL}> /home/system/nohup.out 2>&1 &\""