update deploy scripts

This commit is contained in:
weiweiw 2024-07-30 09:18:38 +08:00
parent 995476dc34
commit 987c4c598c
9 changed files with 347 additions and 0 deletions

View File

@ -0,0 +1,35 @@
# Tomcat
server:
port: 18097
# Spring
spring:
servlet:
multipart:
# 文件最大
max-file-size: 20MB
# 设置总上传数据总大小
max-request-size: 20MB
application:
# 应用名称
name: bonus-ai
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,35 @@
# Tomcat
server:
port: 18091
# Spring
spring:
application:
# 应用名称
name: bonus-auth
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#加密组件
jasypt:
encryptor:
password: Encrypt

View File

@ -0,0 +1,70 @@
#!/bin/bash
export deploy_path=/opt/webapps/bonus-ai
export app_workspace=/home/jenkins/workspace/Bonus-Cloud
export ai_workspace=/home/jenkins/workspace/Bonus-AI-Cloud
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
cp -f ${ai_workspace}/"bonus-ai/target/bonus-ai.jar" $deploy_path
echo "copied ${app_workspace}/${source_jar} to $deploy_path"
# Define an array of JAR files to run
jars=("bonus-auth.jar --spring.config.location=file:auth_bootstrap.yml"
"bonus-gateway.jar --spring.config.location=file:gateway_bootstrap.yml"
"bonus-system.jar --spring.config.location=file:system_bootstrap.yml"
"bonus-gen.jar --spring.config.location=file:gen_bootstrap.yml"
"bonus-job.jar --spring.config.location=file:job_bootstrap.yml"
"bonus-file.jar --spring.config.location=file:file_bootstrap.yml"
"bonus-visual-monitor.jar --spring.config.location=file:visual_bootstrap.yml"
"bonus-ai.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
# 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."

View File

@ -0,0 +1,29 @@
# Tomcat
server:
port: 18093
# Spring
spring:
application:
# 应用名称
name: bonus-file
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,58 @@
# Tomcat
server:
port: 18090
servlet:
context-path: zhgd
# Spring
spring:
application:
# 应用名称
name: bonus-gateway
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
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: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
dataId: sentinel-bonus-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow
#系统 自动 加解密开关
system:
encryptEnabled: false
decryptEnabled: true
#加密组件
jasypt:
encryptor:
password: Encrypt

View File

@ -0,0 +1,29 @@
# Tomcat
server:
port: 18094
# Spring
spring:
application:
# 应用名称
name: bonus-gen
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,29 @@
# Tomcat
server:
port: 18095
# Spring
spring:
application:
# 应用名称
name: bonus-job
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,33 @@
# Tomcat
server:
port: 18092
# Spring
spring:
application:
# 应用名称
name: bonus-system
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
system:
supports:
phoneLogin: true
emailLogin: true

View File

@ -0,0 +1,29 @@
# Tomcat
server:
port: 18096
# Spring
spring:
application:
# 应用名称
name: bonus-monitor
profiles:
# 环境配置
active: dev
cloud:
nacos:
username: nacos
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
config:
# 配置中心地址
server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}