This commit is contained in:
sxu 2024-08-13 08:41:34 +08:00
parent 825c4abb8b
commit fe500aee26
1 changed files with 30 additions and 53 deletions

View File

@ -6,34 +6,30 @@ mkdir -p $deploy_path
cd $deploy_path
rm -rf *.jar
echo "workspace is ${WORKSPACE}"
mv ${WORKSPACE}/sgzb-auth/target/sgzb-auth.jar $deploy_path
mv ${WORKSPACE}/sgzb-gateway/target/sgzb-gateway.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-system/target/sgzb-modules-system.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-base/target/sgzb-modules-base.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-file/target/sgzb-modules-file.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-material/target/sgzb-modules-material.jar $deploy_path
mv ${WORKSPACE}/sgzb-auth/target/sgzb-auth-nx2.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-gateway/target/sgzb-gateway-nx2.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-base/target/sgzb-modules-base-nx2.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-material/target/sgzb-modules-material-nx2.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-system/target/sgzb-modules-system-nx2.0.jar $deploy_path
chmod 777 *.jar
echo "--------moveFile end--------------"
export sgzb_auth_enable=true
export sgzb_gateway_enable=true
export sgzb_modules_system_enable=true
export sgzb_modules_base_enable=true
export sgzb_modules_file_enable=false
export sgzb_modules_material_enable=true
export sgzb_modules_system_enable=true
export sgzb_auth_jar=sgzb-auth-nx2.0.jar
export sgzb_gateway_jar=sgzb-gateway-nx2.0.jar
export sgzb_modules_system_jar=sgzb-modules-system-nx2.0.jar
export sgzb_modules_base_jar=sgzb-modules-base-nx2.0.jar
export sgzb_modules_file_jar=sgzb-modules-file-nx2.0.jar
export sgzb_modules_material_jar=sgzb-modules-material-nx2.0.jar
export sgzb_modules_system_jar=sgzb-modules-system-nx2.0.jar
export sgzb_auth_port=29200
export sgzb_gateway_port=28080
export sgzb_modules_system_port=29201
export sgzb_modules_base_port=29301
export sgzb_modules_file_port=9300
export sgzb_modules_material_port=29302
export sgzb_modules_system_port=29201
if($auth_service_enable);then
echo "--------auth开始启动--------------"
@ -81,27 +77,6 @@ if($sgzb_gateway_enable);then
fi
if($sgzb_modules_system_enable);then
echo "--------sgzb_modules_system 开始启动--------------"
echo "--------删除sgzb_modules_system开始--------------"
P_ID=`ps -ef | grep -w $sgzb_modules_system_jar | grep -v "grep" | awk '{print $2}'`
if [ "$P_ID" == "" ]; then
echo "===sgzb_modules_system process not exists or stop success"
else
kill -9 $P_ID
echo "sgzb_modules_system killed success"
fi
echo "--------sgzb_modules_system开始部署--------------"
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $sgzb_modules_system_jar >/dev/null 2>&1 &
sgzb_modules_system_pid=`lsof -i:$sgzb_modules_system_port|grep "LISTEN"|awk '{print $2}'`
until [ -n "$sgzb_modules_system_pid" ]
do
sgzb_modules_system_pid=`lsof -i:$sgzb_modules_system_port|grep "LISTEN"|awk '{print $2}'`
done
echo "sgzb_modules_system pid is $sgzb_modules_system_pid"
echo "--------sgzb_modules_system 启动成功--------------"
fi
if($sgzb_modules_base_enable);then
echo "--------sgzb_modules_base 开始启动--------------"
echo "--------删除sgzb_modules_base开始--------------"
@ -123,26 +98,6 @@ if($sgzb_modules_base_enable);then
echo "--------sgzb_modules_base 启动成功--------------"
fi
if($sgzb_modules_file_enable);then
echo "--------sgzb_modules_file 开始启动--------------"
echo "--------删除sgzb_modules_file开始--------------"
P_ID=`ps -ef | grep -w $sgzb_modules_file_jar | grep -v "grep" | awk '{print $2}'`
if [ "$P_ID" == "" ]; then
echo "===sgzb_modules_file process not exists or stop success"
else
kill -9 $P_ID
echo "sgzb_modules_file killed success"
fi
echo "--------sgzb_modules_file开始部署--------------"
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $sgzb_modules_file_jar >/dev/null 2>&1 &
sgzb_modules_file_pid=`lsof -i:$sgzb_modules_file_port|grep "LISTEN"|awk '{print $2}'`
until [ -n "$sgzb_modules_file_pid" ]
do
sgzb_modules_file_pid=`lsof -i:$sgzb_modules_file_port|grep "LISTEN"|awk '{print $2}'`
done
echo "sgzb_modules_file pid is $sgzb_modules_file_pid"
echo "--------sgzb_modules_file 启动成功--------------"
fi
if($sgzb_modules_material_enable);then
echo "--------sgzb_modules_material 开始启动--------------"
@ -164,3 +119,25 @@ if($sgzb_modules_material_enable);then
echo "sgzb_modules_material pid is $sgzb_modules_material_pid"
echo "--------sgzb_modules_material 启动成功--------------"
fi
if($sgzb_modules_system_enable);then
echo "--------sgzb_modules_system 开始启动--------------"
echo "--------删除sgzb_modules_system开始--------------"
P_ID=`ps -ef | grep -w $sgzb_modules_system_jar | grep -v "grep" | awk '{print $2}'`
if [ "$P_ID" == "" ]; then
echo "===sgzb_modules_system process not exists or stop success"
else
kill -9 $P_ID
echo "sgzb_modules_system killed success"
fi
echo "--------sgzb_modules_system开始部署--------------"
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $sgzb_modules_system_jar >/dev/null 2>&1 &
sgzb_modules_system_pid=`lsof -i:$sgzb_modules_system_port|grep "LISTEN"|awk '{print $2}'`
until [ -n "$sgzb_modules_system_pid" ]
do
sgzb_modules_system_pid=`lsof -i:$sgzb_modules_system_port|grep "LISTEN"|awk '{print $2}'`
done
echo "sgzb_modules_system pid is $sgzb_modules_system_pid"
echo "--------sgzb_modules_system 启动成功--------------"
fi