From b88f3d3db699542f36b4533f957a4dc5cd6e66c0 Mon Sep 17 00:00:00 2001
From: 钟日健 <5689795+arsn@user.noreply.gitee.com>
Date: Tue, 15 Mar 2022 09:45:12 +0800
Subject: [PATCH] deploy 部署文件修改,pom 修改,Jenkinsfile修改打包命令

---
 Jenkinsfile                             |    2 +-
 deploy/deploy.yml                       |    2 +-
 src/main/resources/application-prod.yml |   24 +++++++++++++-----------
 pom.xml                                 |   32 ++++++++++++++++++++++++++++++++
 4 files changed, 47 insertions(+), 13 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 8b795f3..18425f1 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -21,7 +21,7 @@
       steps {
         container('maven') {
           sh 'ls'
-          sh 'mvn clean package -Dmaven.test.skip=true'
+          sh 'mvn clean package -Dmaven.test.skip=true -P prod'
           sh 'ls target/'
         }
 
diff --git a/deploy/deploy.yml b/deploy/deploy.yml
index d667671..a91d14c 100644
--- a/deploy/deploy.yml
+++ b/deploy/deploy.yml
@@ -25,7 +25,7 @@
       imagePullSecrets:
         - name: aliyun  #提前在项目下配置访问阿里云的账号密码
       containers:
-        - image: registry.cn-hangzhou.aliyuncs.com/arsn/zhbaw:SNAPSHOT-11
+        - image: registry.cn-hangzhou.aliyuncs.com/arsn/zhbaw:SNAPSHOT-13
 #        - image: $REGISTRY/$DOCKERHUB_NAMESPACE/zhba:SNAPSHOT-$BUILD_NUMBER
           imagePullPolicy: Always
           name: zhbaw
diff --git a/pom.xml b/pom.xml
index 28e1ec2..641965f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -270,6 +270,29 @@
         </dependency>
 
     </dependencies>
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <properties>
+                <profile.active>dev</profile.active>
+            </properties>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+        </profile>
+        <profile>
+            <id>test</id>
+            <properties>
+                <profile.active>test</profile.active>
+            </properties>
+        </profile>
+        <profile>
+            <id>prod</id>
+            <properties>
+                <profile.active>prod</profile.active>
+            </properties>
+        </profile>
+    </profiles>
 
     <build>
         <finalName>${bladex.project.id}</finalName>
@@ -283,6 +306,15 @@
                     <include>**/*.xml</include>
                 </includes>
             </resource>
+            <!-- 根据env部署环境值,把对应环境的配置文件拷贝到classes目录 -->
+            <resource>
+                <directory>src/main/resources/${profile.active}</directory>
+                <targetPath>${project.build.directory}/classes</targetPath>
+                <includes>
+                    <include>**/*.*</include>
+                </includes>
+                <filtering>true</filtering>
+            </resource>
         </resources>
         <pluginManagement>
             <plugins>
diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml
index 2f73e39..0059807 100644
--- a/src/main/resources/application-prod.yml
+++ b/src/main/resources/application-prod.yml
@@ -13,9 +13,9 @@
     #  commandTimeout: 5000
   datasource:
     # MySql
-    url: jdbc:mysql://223.82.109.183:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    url: jdbc:mysql://mysql.zhba:3306/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
     username: root
-    password: ZHba@0112
+    password: 123456
 
     # PostgreSQL
     #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot
@@ -33,23 +33,25 @@
 
 #图片批量上传zip
 upload:
-  localtion: ${UPLOAD_DIR:D:/test}
+  localtion: ${UPLOAD_DIR:/home/zhongsong/anbao}
   maxFileSize: 10240KB
   maxRequestSize: 102400KB
 
 #ftp 设置
 ftp:
-  sqlConnect: jdbc:mysql://223.82.109.183:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
-  ftpHost: 192.168.0.199
+  sqlConnect: jdbc:mysql://mysql.zhba:3306/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+  ftpHost: 172.19.1.30
   ftpPort: 21
-  ftpUserName: arsn
-  ftpPassword: 123456
-  ftpPath: anbao/
-  localPath: D:\\anbao\\
-  ip: http://223.82.109.183:2081
-  jsonUrl: D:\\anbao\\
+  ftpUserName: yly
+  ftpPassword: Yly@123
+  ftpPath: yly/anbao/
+  localPath: /home/zhongsong/anbao/
+  ip: http://47.49.36.190:9000
+  jsonUrl: /home/zhongsong/anbao/
   username: root
   password: ZHba@0112
+  #  qfqkBaseApiUrl: http://223.82.109.183:2082/api
+  qfqkBaseApiUrl: http://localhost:83
 
 #第三方登陆
 social:

--
Gitblit v1.9.3