Răsfoiți Sursa

`fix 部署正式`

wenhongquan 2 ani în urmă
părinte
comite
7e4a5f1c96

+ 35 - 0
ruoyi-admin/pom.xml

@@ -125,6 +125,41 @@
                     <warName>${project.artifactId}</warName>
                 </configuration>
             </plugin>
+
+
+            <plugin>
+                <groupId>com.google.cloud.tools</groupId>
+                <artifactId>jib-maven-plugin</artifactId>
+                <version>1.7.0</version>
+                <configuration>
+                    <!--from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字-->
+                    <from>
+                        <image>docker.xt.wenhq.top:8083/docker_r/javarun:1.0</image>
+                    </from>
+                    <to>
+                        <!--镜像名称和tag,使用了mvn内置变量${project.version},表示当前工程的version-->
+                        <image>docker.xt.wenhq.top:8083/docker_r/ioc:${project.version}</image>
+                        <auth>
+                            <username>admin</username>
+                            <password>xtwenhongquan</password>
+                        </auth>
+                    </to>
+                    <!--容器相关的属性-->
+                    <container>
+                        <useCurrentTimestamp>true</useCurrentTimestamp>
+                    </container>
+                    <allowInsecureRegistries>true</allowInsecureRegistries>
+
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>build</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 

+ 8 - 8
ruoyi-admin/src/main/resources/application-dev.yml

@@ -37,7 +37,7 @@ spring:
     # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
     dynamic:
       # 性能分析插件(有性能损耗 不建议生产环境使用)
-      p6spy: true
+      p6spy: false
       # 设置默认的数据源或者数据源组,默认值即为 master
       primary: master
       # 严格模式 匹配不到数据源则报错
@@ -49,9 +49,9 @@ spring:
           driverClassName: com.mysql.cj.jdbc.Driver
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://xt.wenhq.top:8583/iotc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-          username: root
-          password: root
+          url: jdbc:mysql://${DBHOST:xt.wenhq.top}:${DBPORT:8583}/iotc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          username: ${DBUSER:root}
+          password: ${DBPWD:root}
         # 从库数据源
         slave:
           lazy: true
@@ -102,13 +102,13 @@ spring:
 spring:
   redis:
     # 地址
-    host: 60.204.209.152
+    host: ${REDIS_HOST:60.204.209.152}
     # 端口,默认为6379
-    port: 6379
+    port: ${REDIS_PORT:6379}
     # 数据库索引
-    database: 0
+    database: ${REDIS_DB:0}
     # 密码(如没有密码请注释掉)
-    password: 123456
+    password: ${REDIS_PWD:123456}
     # 连接超时时间
     timeout: 10s
     # 是否开启ssl

+ 20 - 0
ruoyi-ui-vue3/.env.test

@@ -0,0 +1,20 @@
+# 页面标题
+VITE_APP_TITLE = 物联网平台
+
+# 生产环境配置
+VITE_APP_ENV = 'test'
+
+# 应用访问路径 例如使用前缀 /admin/
+VITE_APP_CONTEXT_PATH = '/'
+
+# 监控地址
+VITE_APP_MONITRO_ADMIN = '/admin/applications'
+
+# 监控地址
+VITE_APP_XXL_JOB_ADMIN = '/xxl-job-admin'
+
+# 若依管理系统/生产环境
+VITE_APP_BASE_API = 'http://iotc-bg.xt.wenhq.top:8083/'
+
+# 是否在打包时开启压缩,支持 gzip 和 brotli
+VITE_BUILD_COMPRESS = gzip

+ 1 - 0
ruoyi-ui-vue3/package.json

@@ -7,6 +7,7 @@
   "scripts": {
     "dev": "vite",
     "build:prod": "vite build",
+    "build:test": "vite build --mode test",
     "preview": "vite preview"
   },
   "repository": {