add scripts
This commit is contained in:
parent
23f903eaac
commit
2d82049588
|
|
@ -0,0 +1,35 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18581
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-auth
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
||||||
|
#加密组件
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
password: Encrypt
|
||||||
|
|
||||||
|
|
@ -1,37 +1,87 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
export deploy_path=/opt/builds/${JOB_NAME}
|
|
||||||
|
|
||||||
echo "--------moveFile start--------------"
|
export deploy_path=/opt/webapps/bonus-material
|
||||||
rm -rf $deploy_path
|
|
||||||
mkdir -p $deploy_path
|
|
||||||
cd $deploy_path
|
|
||||||
rm -rf *.jar
|
|
||||||
echo "workspace is ${WORKSPACE}"
|
|
||||||
mv ${WORKSPACE}/bonus-modules/bonus-material/target/bonus-material.jar $deploy_path
|
|
||||||
chmod 777 *.jar
|
|
||||||
|
|
||||||
echo "--------moveFile end--------------"
|
export app_workspace=/home/jenkins/workspace/Bonus-Cloud
|
||||||
export bonus_material_enable=true
|
export biz_workspace=/home/jenkins/workspace/Bonus-Cloud-Material
|
||||||
export bonus_material_jar=bonus-material.jar
|
|
||||||
export bonus_material_port=18588
|
suffix="-material"
|
||||||
|
|
||||||
|
|
||||||
|
app_source_jars=(
|
||||||
|
"bonus-auth/target/bonus-auth.jar"
|
||||||
|
"bonus-gateway/target/bonus-gateway.jar"
|
||||||
|
"bonus-modules/bonus-file/target/bonus-file.jar"
|
||||||
|
"bonus-modules/bonus-gen/target/bonus-gen.jar"
|
||||||
|
"bonus-modules/bonus-job/target/bonus-job.jar"
|
||||||
|
"bonus-modules/bonus-oss/target/bonus-oss.jar"
|
||||||
|
"bonus-modules/bonus-system/target/bonus-system.jar"
|
||||||
|
"bonus-visual/bonus-monitor/target/bonus-visual-monitor.jar"
|
||||||
|
)
|
||||||
|
|
||||||
|
#for source_jar in "${app_source_jars[@]}"; do
|
||||||
|
# cp -f ${app_workspace}/${source_jar} $deploy_path
|
||||||
|
# echo "copied ${app_workspace}/${source_jar} to $deploy_path"
|
||||||
|
#done
|
||||||
|
for source_jar in "${app_source_jars[@]}"; do
|
||||||
|
# 获取文件名(不带目录路径)
|
||||||
|
filename=$(basename "$source_jar")
|
||||||
|
echo "filename:$filename"
|
||||||
|
# 获取文件名(不带扩展名)
|
||||||
|
base_name="${filename%.jar}"
|
||||||
|
echo "filename:$base_name"
|
||||||
|
# 构造新的文件名
|
||||||
|
new_filename="${base_name}${suffix}.jar"
|
||||||
|
echo "filename:$new_filename"
|
||||||
|
|
||||||
|
cp -f ${app_workspace}/${source_jar} "$deploy_path/$new_filename"
|
||||||
|
echo "copied ${app_workspace}/${source_jar} to '$deploy_path/$new_filename'"
|
||||||
|
done
|
||||||
|
|
||||||
|
cp -f ${biz_workspace}/"bonus-modules/bonus-material/target/bonus-material.jar" $deploy_path
|
||||||
|
echo "copied ${app_workspace}/${source_jar} to $deploy_path"
|
||||||
|
|
||||||
|
# Define an array of JAR files to run
|
||||||
|
jars=("bonus-auth-material.jar --spring.config.location=file:auth_bootstrap.yml"
|
||||||
|
"bonus-gateway-material.jar --spring.config.location=file:gateway_bootstrap.yml"
|
||||||
|
"bonus-system-material.jar --spring.config.location=file:system_bootstrap.yml"
|
||||||
|
"bonus-gen-material.jar --spring.config.location=file:gen_bootstrap.yml"
|
||||||
|
"bonus-job-material.jar --spring.config.location=file:job_bootstrap.yml"
|
||||||
|
"bonus-file-material.jar --spring.config.location=file:file_bootstrap.yml"
|
||||||
|
"bonus-visual-monitor-material.jar --spring.config.location=file:visual_bootstrap.yml"
|
||||||
|
"bonus-modules-material.jar --spring.config.location=file:ai_bootstrap.yml")
|
||||||
|
|
||||||
|
# 遍历数组并检查每个JAR文件的进程
|
||||||
|
for jar_with_args in "${jars[@]}"; do
|
||||||
|
# 提取JAR文件名(不包括参数)
|
||||||
|
jar=$(echo $jar_with_args | awk '{print $1}')
|
||||||
|
|
||||||
|
# 检查进程是否启动
|
||||||
|
echo "原应用程序1 $jar "
|
||||||
|
pids=$(pgrep -f $jar || true)
|
||||||
|
echo "原应用程序2 $jar "
|
||||||
|
if [ -n "$pids" ]; then
|
||||||
|
echo "$jar is running with PID(s): $pids"
|
||||||
|
# 杀死进程
|
||||||
|
for pid in $pids; do
|
||||||
|
kill -9 $pid
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Process $pid for $jar killed successfully"
|
||||||
|
else
|
||||||
|
echo "Failed to kill process $pid for $jar"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "$jar is not running"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
cd $deploy_path || { echo "Failed to change directory to $deploy_path"; exit 1; }
|
||||||
|
# Iterate over the JAR files array
|
||||||
|
for jar in "${jars[@]}"; do
|
||||||
|
echo "Starting $jar"
|
||||||
|
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $jar >/dev/null 2>&1 &
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All JARs have been run successfully."
|
||||||
|
|
||||||
if($bonus_material_enable);then
|
|
||||||
echo "--------bonus_material 开始启动--------------"
|
|
||||||
echo "--------删除bonus__material开始--------------"
|
|
||||||
P_ID=`ps -ef | grep -w $bonus_material_jar | grep -v "grep" | awk '{print $2}'`
|
|
||||||
if [ "$P_ID" == "" ]; then
|
|
||||||
echo "===bonus_material process not exists or stop success"
|
|
||||||
else
|
|
||||||
kill -9 $P_ID
|
|
||||||
echo "bonus_material killed success"
|
|
||||||
fi
|
|
||||||
echo "--------bonus_material开始部署--------------"
|
|
||||||
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $bonus_material_jar >/dev/null 2>&1 &
|
|
||||||
bonus_material_pid=`lsof -i:$bonus_material_port|grep "LISTEN"|awk '{print $2}'`
|
|
||||||
until [ -n "$bonus_material_pid" ]
|
|
||||||
do
|
|
||||||
bonus_material_pid=`lsof -i:$bonus_material_port|grep "LISTEN"|awk '{print $2}'`
|
|
||||||
done
|
|
||||||
echo "bonus_material pid is $bonus_material_pid"
|
|
||||||
echo "--------bonus_material 启动成功--------------"
|
|
||||||
fi
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/sh
|
||||||
|
export deploy_path=/opt/builds/${JOB_NAME}
|
||||||
|
|
||||||
|
echo "--------moveFile start--------------"
|
||||||
|
rm -rf $deploy_path
|
||||||
|
mkdir -p $deploy_path
|
||||||
|
cd $deploy_path
|
||||||
|
rm -rf *.jar
|
||||||
|
echo "workspace is ${WORKSPACE}"
|
||||||
|
mv ${WORKSPACE}/bonus-modules/bonus-material/target/bonus-material.jar $deploy_path
|
||||||
|
chmod 777 *.jar
|
||||||
|
|
||||||
|
echo "--------moveFile end--------------"
|
||||||
|
export bonus_material_enable=true
|
||||||
|
export bonus_material_jar=bonus-material.jar
|
||||||
|
export bonus_material_port=18588
|
||||||
|
|
||||||
|
if($bonus_material_enable);then
|
||||||
|
echo "--------bonus_material 开始启动--------------"
|
||||||
|
echo "--------删除bonus__material开始--------------"
|
||||||
|
P_ID=`ps -ef | grep -w $bonus_material_jar | grep -v "grep" | awk '{print $2}'`
|
||||||
|
if [ "$P_ID" == "" ]; then
|
||||||
|
echo "===bonus_material process not exists or stop success"
|
||||||
|
else
|
||||||
|
kill -9 $P_ID
|
||||||
|
echo "bonus_material killed success"
|
||||||
|
fi
|
||||||
|
echo "--------bonus_material开始部署--------------"
|
||||||
|
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $bonus_material_jar >/dev/null 2>&1 &
|
||||||
|
bonus_material_pid=`lsof -i:$bonus_material_port|grep "LISTEN"|awk '{print $2}'`
|
||||||
|
until [ -n "$bonus_material_pid" ]
|
||||||
|
do
|
||||||
|
bonus_material_pid=`lsof -i:$bonus_material_port|grep "LISTEN"|awk '{print $2}'`
|
||||||
|
done
|
||||||
|
echo "bonus_material pid is $bonus_material_pid"
|
||||||
|
echo "--------bonus_material 启动成功--------------"
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18583
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-file
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18580
|
||||||
|
servlet:
|
||||||
|
context-path: zhgd
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-gateway
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
sentinel:
|
||||||
|
# 取消控制台懒加载
|
||||||
|
eager: true
|
||||||
|
transport:
|
||||||
|
# 控制台地址
|
||||||
|
dashboard: 192.168.0.14:18858
|
||||||
|
# nacos配置持久化
|
||||||
|
datasource:
|
||||||
|
ds1:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
dataId: sentinel-bonus-gateway
|
||||||
|
groupId: DEFAULT_GROUP
|
||||||
|
data-type: json
|
||||||
|
rule-type: gw-flow
|
||||||
|
|
||||||
|
|
||||||
|
#系统 自动 加解密开关
|
||||||
|
system:
|
||||||
|
encryptEnabled: false
|
||||||
|
decryptEnabled: true
|
||||||
|
#加密组件
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
password: Encrypt
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18584
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-gen
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18585
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-job
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18588
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
# 文件最大
|
||||||
|
max-file-size: 20MB
|
||||||
|
# 设置总上传数据总大小
|
||||||
|
max-request-size: 20MB
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-material
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18582
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-system
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
system:
|
||||||
|
supports:
|
||||||
|
phoneLogin: true
|
||||||
|
emailLogin: true
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 18586
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: bonus-monitor
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: sgzb_bns_test
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.0.56:8848
|
||||||
|
namespace: sgzb_bns
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
Loading…
Reference in New Issue