Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-11-07 16:33:26 +08:00
commit c84865ee1f
1 changed files with 7 additions and 22 deletions

View File

@ -81,43 +81,28 @@ if [ -f "${APP_DIR}/tmp/${APP_NAME}/${APP_NAME}.jar" ]; then
# 删除文件夹,再重新创建,这样上面才可以检测时间
rm -rf ${APP_DIR}/snapshot
mkdir -p ${APP_DIR}/snapshot
# 备份lib、resources、jar
# 备份lib、jar
\cp -rf ${APP_DIR}/lib ${APP_DIR}/snapshot
\cp -rf ${APP_DIR}/resources ${APP_DIR}/snapshot
\cp -rf ${APP_DIR}/config ${APP_DIR}/snapshot
\cp -rf ${APP_DIR}/${APP_NAME}.jar ${APP_DIR}/snapshot
echo "${APP_NAME} 项目备份完成"
fi
# 更新项目
if [ -f "${APP_DIR}/tmp/${APP_NAME}/${APP_NAME}.version.replace" ]; then
echo "正在进行全量更新"
# 备份配置文件
mv -f ${APP_DIR}/resources/application-prod.yml ${APP_DIR}/application-prod.yml
# 移除lib、resources、jar
rm -rf ${APP_DIR}/lib
rm -rf ${APP_DIR}/resources
rm -rf ${APP_DIR}/${APP_NAME}.jar
# 创建resources将配置文件copy回去
mkdir -p ${APP_DIR}/resources
mv -f ${APP_DIR}/application-prod.yml ${APP_DIR}/resources/application-prod.yml
rm -rf ${APP_DIR}/tmp/${APP_NAME}/resources/application-prod.yml
else
# 这里不用移除前端静态资源,前端静态资源独立部署
echo "正在进行增量更新"
rm -rf ${APP_DIR}/lib/ava-*.jar
fi
echo "正在进行增量更新"
rm -rf ${APP_DIR}/lib/*.jar
echo "已删除lib依赖"
\cp -rf ${APP_DIR}/tmp/${APP_NAME}/lib ${APP_DIR}/
\cp -rf ${APP_DIR}/tmp/${APP_NAME}/resources ${APP_DIR}/
\cp -rf ${APP_DIR}/tmp/${APP_NAME}/config ${APP_DIR}/
\cp -rf ${APP_DIR}/tmp/${APP_NAME}/${APP_NAME}.jar ${APP_DIR}/
echo "${APP_NAME} 项目更新完成"
else
echo "${APP_NAME} 项目程序不存在"
fi
# 移除更新包以及更新的项目
rm -rf ${APP_DIR}/tmp/*
# 重启平台
sh ${APP_DIR}/renren-admin.sh start ${$PROFILES_ACTIVE}
exit 0