update deploy scripts to rename public jar name

This commit is contained in:
weiweiw 2024-07-30 10:23:33 +08:00
parent 262956ad9f
commit 449276b2cd
1 changed files with 25 additions and 10 deletions

View File

@ -5,6 +5,8 @@ export deploy_path=/opt/webapps/bonus-ai
export app_workspace=/home/jenkins/workspace/Bonus-Cloud
export ai_workspace=/home/jenkins/workspace/Bonus-AI-Cloud
suffix="-ai"
app_source_jars=(
"bonus-auth/target/bonus-auth.jar"
@ -17,22 +19,36 @@ app_source_jars=(
"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
cp -f ${app_workspace}/${source_jar} $deploy_path
echo "copied ${app_workspace}/${source_jar} to $deploy_path"
# 获取文件名(不带目录路径)
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 ${ai_workspace}/"bonus-modules/bonus-ai/target/bonus-modules-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"
jars=("bonus-auth-ai.jar --spring.config.location=file:auth_bootstrap.yml"
"bonus-gateway-ai.jar --spring.config.location=file:gateway_bootstrap.yml"
"bonus-system-ai.jar --spring.config.location=file:system_bootstrap.yml"
"bonus-gen-ai.jar --spring.config.location=file:gen_bootstrap.yml"
"bonus-job-ai.jar --spring.config.location=file:job_bootstrap.yml"
"bonus-file-ai.jar --spring.config.location=file:file_bootstrap.yml"
"bonus-visual-monitor-ai.jar --spring.config.location=file:visual_bootstrap.yml"
"bonus-modules-ai.jar --spring.config.location=file:ai_bootstrap.yml")
# 遍历数组并检查每个JAR文件的进程
@ -60,7 +76,6 @@ for jar_with_args in "${jars[@]}"; do
fi
done
cd $deploy_path
# Iterate over the JAR files array
for jar in "${jars[@]}"; do
echo "Starting $jar"