change profile

This commit is contained in:
sxu 2024-08-16 19:12:50 +08:00
parent 17f52add11
commit 854a9b3dc4
19 changed files with 348 additions and 224 deletions

View File

@ -1,38 +1,31 @@
#!/bin/sh
export deploy_path=/opt/builds/${JOB_NAME}/${BUILD_NUMBER}
#export deploy_path=/opt/builds/${JOB_NAME}/${BUILD_NUMBER}
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}/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-cq1.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-gateway/target/sgzb-gateway-cq1.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-system/target/sgzb-modules-system-cq1.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-material/target/sgzb-modules-material-cq1.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=false
export sgzb_modules_file_enable=false
export sgzb_modules_material_enable=true
export sgzb_auth_jar=sgzb-auth.jar
export sgzb_gateway_jar=sgzb-gateway.jar
export sgzb_modules_system_jar=sgzb-modules-system.jar
export sgzb_modules_base_jar=sgzb-modules-base.jar
export sgzb_modules_file_jar=sgzb-modules-file.jar
export sgzb_modules_material_jar=sgzb-modules-material.jar
export sgzb_auth_jar=sgzb-auth-cq1.0.jar
export sgzb_gateway_jar=sgzb-gateway-cq1.0.jar
export sgzb_modules_system_jar=sgzb-modules-system-cq1.0.jar
export sgzb_modules_material_jar=sgzb-modules-material-cq1.0.jar
export sgzb_auth_port=39200
export sgzb_gateway_port=39080
export sgzb_modules_system_port=39201
export sgzb_modules_base_port=39301
export sgzb_modules_file_port=39300
export sgzb_modules_material_port=39302
if($auth_service_enable);then
@ -102,47 +95,6 @@ if($sgzb_modules_system_enable);then
echo "--------sgzb_modules_system 启动成功--------------"
fi
if($sgzb_modules_base_enable);then
echo "--------sgzb_modules_base 开始启动--------------"
echo "--------删除sgzb_modules_base开始--------------"
P_ID=`ps -ef | grep -w $sgzb_modules_base_jar | grep -v "grep" | awk '{print $2}'`
if [ "$P_ID" == "" ]; then
echo "===sgzb_modules_base process not exists or stop success"
else
kill -9 $P_ID
echo "sgzb_modules_base killed success"
fi
echo "--------sgzb_modules_base开始部署--------------"
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $sgzb_modules_base_jar >/dev/null 2>&1 &
sgzb_modules_base_pid=`lsof -i:$sgzb_modules_base_port|grep "LISTEN"|awk '{print $2}'`
until [ -n "$sgzb_modules_base_pid" ]
do
sgzb_modules_base_pid=`lsof -i:$sgzb_modules_base_port|grep "LISTEN"|awk '{print $2}'`
done
echo "sgzb_modules_base pid is $sgzb_modules_base_pid"
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 开始启动--------------"

View File

@ -5,6 +5,7 @@ pipeline {
JAVA_HOME = '/usr/lib/jvm/jdk1.8.0_381'
JOBNAME="${JOB_NAME}"
JENKINS_NODE_COOKIE = "dontKillMe"
SPRING_PROFILES_ACTIVE = "sgzb_cloud_dev"
}
stages {
stage('Check out') {

View File

@ -8,7 +8,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sgzb-auth</artifactId>
<artifactId>sgzb-auth-cq1.0</artifactId>
<description>
sgzb-auth认证授权中心

View File

@ -0,0 +1,34 @@
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
onlineApprove: /lbcloud-oauth/oauth/token
wechatAppId: crhmaxnE
wechatAppsecret: 3893e6ed90d325f00e34583dd970a56580c05549
getNowPersonDetailData: /lbcloud-user/user/queryLoginUserInfo
baseUrl: https://test-sso.csgmall.com.cn
appAppsecret: d8e6db9fa9bb09da0e270fa739233c823bf9c5f0
personEasyList: /lbcloud-user/api/user/queryAndPaging/basicInfo
h5Appsecret: 3c4a67b7f6a268b4202a5328e6a1726979d5903b
h5AppId: G3NksDH2
appsecret: 596e4863c8d112842ce820c130b236001297ea73
appId: akvVFYgy
appAppId: u8LLfynf
getPersonDetailData: /lbcloud-user/api/user/queryById
registerPhone: /lbcloud-user/api/user/registrationByPhone
userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole
verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode

View File

@ -0,0 +1,34 @@
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
onlineApprove: /lbcloud-oauth/oauth/token
wechatAppId: crhmaxnE
wechatAppsecret: 3893e6ed90d325f00e34583dd970a56580c05549
getNowPersonDetailData: /lbcloud-user/user/queryLoginUserInfo
baseUrl: https://test-sso.csgmall.com.cn
appAppsecret: d8e6db9fa9bb09da0e270fa739233c823bf9c5f0
personEasyList: /lbcloud-user/api/user/queryAndPaging/basicInfo
h5Appsecret: 3c4a67b7f6a268b4202a5328e6a1726979d5903b
h5AppId: G3NksDH2
appsecret: 596e4863c8d112842ce820c130b236001297ea73
appId: akvVFYgy
appAppId: u8LLfynf
getPersonDetailData: /lbcloud-user/api/user/queryById
registerPhone: /lbcloud-user/api/user/registrationByPhone
userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole
verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode

View File

@ -9,36 +9,4 @@ spring:
name: sgzb-auth
profiles:
# 环境配置
active: sgzb_cloud_dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
onlineApprove: /lbcloud-oauth/oauth/token
wechatAppId: crhmaxnE
wechatAppsecret: 3893e6ed90d325f00e34583dd970a56580c05549
getNowPersonDetailData: /lbcloud-user/user/queryLoginUserInfo
baseUrl: https://test-sso.csgmall.com.cn
appAppsecret: d8e6db9fa9bb09da0e270fa739233c823bf9c5f0
personEasyList: /lbcloud-user/api/user/queryAndPaging/basicInfo
h5Appsecret: 3c4a67b7f6a268b4202a5328e6a1726979d5903b
h5AppId: G3NksDH2
appsecret: 596e4863c8d112842ce820c130b236001297ea73
appId: akvVFYgy
appAppId: u8LLfynf
getPersonDetailData: /lbcloud-user/api/user/queryById
registerPhone: /lbcloud-user/api/user/registrationByPhone
userBindUrl: /lbcloud-authority/api/RoleClient/bindDefaultSystemRole
verifyPhoneCode: /lbcloud-mbroker/api/broker/simpleVerificationCode
active: sgzb_cloud_local

View File

@ -8,7 +8,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sgzb-gateway</artifactId>
<artifactId>sgzb-gateway-cq1.0</artifactId>
<description>
sgzb-gateway网关模块

View File

@ -25,6 +25,14 @@ public class SgzbGatewayApplication implements CommandLineRunner {
private StringEncryptor encryptor;
@Override
public void run(String... args) throws Exception {
// String nacos = encrypt("Jjsp@nacos2023" );
// String mysqlNm = encrypt("prod_rental" );
// String mysqlPs = encrypt("bx%RlBIJOyDzHShQpeWI" );
// String redis = encrypt("Dszbns@Redis123!" );
// System.err.println( "nacos原始明文密码加密后的结果为" + nacos );
// System.err.println( "mysqlNm原始明文密码加密后的结果为" + mysqlNm );
// System.err.println( "mysqlPs原始明文密码加密后的结果为" + mysqlPs );
// System.err.println( "redis原始明文密码加密后的结果为" + redis );
}

View File

@ -0,0 +1,50 @@
# Spring Boot Actuator V2中风险漏洞处理禁止远程端口访问
management:
endpoint:
env:
enabled: false
# Spring
spring:
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:8718
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: 192.168.0.14:8848
dataId: sentinel-sgzb-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow
#加密组件
jasypt:
encryptor:
password: Encrypt

View File

@ -0,0 +1,50 @@
# Spring Boot Actuator V2中风险漏洞处理禁止远程端口访问
management:
endpoint:
env:
enabled: false
# Spring
spring:
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:8718
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: 192.168.0.14:8848
dataId: sentinel-sgzb-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow
#加密组件
jasypt:
encryptor:
password: Encrypt

View File

@ -2,12 +2,6 @@
server:
port: 39080
# Spring Boot Actuator V2中风险漏洞处理禁止远程端口访问
management:
endpoint:
env:
enabled: false
# Spring
spring:
application:
@ -15,46 +9,4 @@ spring:
name: sgzb-gateway
profiles:
# 环境配置
active: sgzb_cloud_dev
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:8718
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: 192.168.0.14:8848
dataId: sentinel-sgzb-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow
#加密组件
jasypt:
encryptor:
password: Encrypt
active: sgzb_cloud_local

View File

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sgzb-modules-material</artifactId>
<artifactId>sgzb-modules-material-cq1.0</artifactId>
<description>
sgzb-modules-material

View File

@ -0,0 +1,31 @@
# Spring
spring:
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# 多站点特殊配置
sgzb:
site: cq
job:
settlementJobDay: 21
settlementJobCron: "0 0 1 21 * ?"

View File

@ -0,0 +1,31 @@
# Spring
spring:
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# 多站点特殊配置
sgzb:
site: cq
job:
settlementJobDay: 21
settlementJobCron: "0 0 1 21 * ?"

View File

@ -9,33 +9,4 @@ spring:
name: sgzb-material
profiles:
# 环境配置
active: sgzb_cloud_dev
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# 多站点特殊配置
sgzb:
site: cq
job:
settlementJobDay: 21
settlementJobCron: "0 0 1 21 * ?"
active: sgzb_cloud_local

View File

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sgzb-modules-system</artifactId>
<artifactId>sgzb-modules-system-cq1.0</artifactId>
<description>
sgzb-modules-system系统模块

View File

@ -0,0 +1,46 @@
# Spring
spring:
servlet:
multipart:
max-request-size: 50MB
max-file-size: 30MB
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#腾讯云sms
tencent:
sms:
#api秘钥标识
accessKeyId: AKIDrreCVaRKDtMcgfU5QW9iEfv67tMfldJn
#api秘钥
accessKeySecret: OXUgeMo0yhBRTGo6sVu3yiFX4rQtAzc3
#请求域名
endpoint: sms.tencentcloudapi.com
#所属区域
region: ap-guangzhou
#腾讯云申请应用id
sdkAppId: 1400494336
#签名
smsSign: 南方电网互联网
#云平台模板id 2116937-验收通知 2115503-登录验证
templateId: 2116937,2115503

View File

@ -0,0 +1,45 @@
# Spring
spring:
servlet:
multipart:
max-request-size: 50MB
max-file-size: 30MB
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#腾讯云sms
tencent:
sms:
#api秘钥标识
accessKeyId: AKIDrreCVaRKDtMcgfU5QW9iEfv67tMfldJn
#api秘钥
accessKeySecret: OXUgeMo0yhBRTGo6sVu3yiFX4rQtAzc3
#请求域名
endpoint: sms.tencentcloudapi.com
#所属区域
region: ap-guangzhou
#腾讯云申请应用id
sdkAppId: 1400494336
#签名
smsSign: 南方电网互联网
#云平台模板id 2116937-验收通知 2115503-登录验证
templateId: 2116937,2115503

View File

@ -4,58 +4,9 @@ server:
# Spring
spring:
servlet:
multipart:
max-request-size: 50MB
max-file-size: 30MB
application:
# 应用名称
name: sgzb-system
profiles:
# 环境配置
active: sgzb_cloud_dev
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: sgzb_cloud_dev_cqjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#腾讯云sms
tencent:
sms:
#api秘钥标识
accessKeyId: AKIDrreCVaRKDtMcgfU5QW9iEfv67tMfldJn
#api秘钥
accessKeySecret: OXUgeMo0yhBRTGo6sVu3yiFX4rQtAzc3
#请求域名
endpoint: sms.tencentcloudapi.com
#所属区域
region: ap-guangzhou
#腾讯云申请应用id
sdkAppId: 1400494336
#签名
smsSign: 南方电网互联网
#云平台模板id 2116937-验收通知 2115503-登录验证
templateId: 2116937,2115503
active: sgzb_cloud_local