bwcx_jzy 2 gadi atpakaļ
vecāks
revīzija
0c6d835f0b

+ 4 - 0
.dockerignore

@@ -201,3 +201,7 @@ dist
 .yarn/build-state.yml
 .yarn/install-state.gz
 .pnp.*
+
+.git
+modules/server/logs
+modules/agent/logs

+ 23 - 0
.gitee/ISSUE_TEMPLATE/config.yaml

@@ -1,3 +1,26 @@
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2019 Code Technology Studio
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of
+# this software and associated documentation files (the "Software"), to deal in
+# the Software without restriction, including without limitation the rights to
+# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+# the Software, and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
 blank_issues_enabled: false
 contact_links:
     - name: Jpom 官方文档

+ 1 - 0
README.md

@@ -289,6 +289,7 @@ docker-compose -f docker-compose.yml up
 # docker-compose -f docker-compose.yml build --no-cache
 # docker-compose -f docker-compose-local.yml up
 # docker-compose -f docker-compose-local.yml build --build-arg TEMP_VERSION=.0
+# docker-compose -f docker-compose-cluster.yml up --build
 ```
 
 ### 方式六:💻 编译运行

+ 85 - 0
docker-compose-cluster.yml

@@ -0,0 +1,85 @@
+version: '3.8'
+services:
+  server:
+    env_file:
+      - env-beta.env
+    image: jpomdocker/jpom:server-${JPOM_VERSION}
+    build:
+      dockerfile: ./modules/server/Dockerfile
+      context: .
+      args:
+        JPOM_VERSION: ${JPOM_VERSION}
+    environment:
+      "JPOM_SERVER_TEMP_TOKEN": ${SERVER_TOKEN}
+      "jpom.cluster.id": server00
+    volumes:
+      - jpom-server-data:/usr/local/jpom-server/data
+      - jpom-server-logs:/usr/local/jpom-server/logs
+      - jpom-server-conf:/usr/local/jpom-server/conf
+    ports:
+      - "2122:2122"
+    hostname: server
+  server01:
+    env_file:
+      - env-beta.env
+    image: jpomdocker/jpom:server-${JPOM_VERSION}
+    build:
+      dockerfile: ./modules/server/Dockerfile
+      context: .
+      args:
+        JPOM_VERSION: ${JPOM_VERSION}
+    environment:
+      "JPOM_SERVER_TEMP_TOKEN": ${SERVER_TOKEN}
+      "jpom.cluster.id": server01
+    volumes:
+      - jpom-server01-data:/usr/local/jpom-server/data
+      - jpom-server01-logs:/usr/local/jpom-server/logs
+      - jpom-server01-conf:/usr/local/jpom-server/conf
+    ports:
+      - "2120:2122"
+    hostname: server01
+  agent01:
+    env_file:
+      - env-beta.env
+    image: jpomdocker/jpom:agent-${JPOM_VERSION}
+    build:
+      dockerfile: ./modules/agent/Dockerfile
+      context: .
+      args:
+        JPOM_VERSION: ${JPOM_VERSION}
+        RUN_ARG: --auto-push-to-server 'http://server:2122/api/node/receive_push?token=${SERVER_TOKEN}&workspaceId=DEFAULT'
+
+    volumes:
+      - jpom-agent01:/usr/local/jpom-agent
+    ports:
+      - "2123:2123"
+    depends_on:
+      - server
+    hostname: agent01
+  agent02:
+    env_file:
+      - env-beta.env
+    image: jpomdocker/jpom:agent-${JPOM_VERSION}
+    build:
+      dockerfile: ./modules/agent/Dockerfile
+      context: .
+      args:
+        JPOM_VERSION: ${JPOM_VERSION}
+        RUN_ARG: --auto-push-to-server 'http://server01:2122/api/node/receive_push?token=${SERVER_TOKEN}&workspaceId=DEFAULT'
+
+    volumes:
+      - jpom-agent02:/usr/local/jpom-agent
+    ports:
+      - "2124:2123"
+    depends_on:
+      - server01
+    hostname: agent02
+volumes:
+  jpom-agent01:
+  jpom-agent02:
+  jpom-server-data:
+  jpom-server-logs:
+  jpom-server-conf:
+  jpom-server01-data:
+  jpom-server01-logs:
+  jpom-server01-conf:

+ 1 - 1
modules/agent/Dockerfile

@@ -30,7 +30,7 @@ VOLUME ["/root/.m2"]
 ARG TEMP_VERSION=""
 ARG JPOM_VERSION
 ENV USE_JPOM_VERSION=${JPOM_VERSION}${TEMP_VERSION}
-RUN --mount=type=cache,target=/root/.m2 sh ./script/replaceVersion.sh ${USE_JPOM_VERSION}
+RUN --mount=type=cache,target=/root/.m2 sh ./script/replaceVersion.sh ${USE_JPOM_VERSION} "release"
 
 RUN --mount=type=cache,target=/root/.m2 mvn -B -e -T 1C clean package -pl modules/agent -am -Dmaven.test.skip=true -Dmaven.compile.fork=true -s script/settings.xml
 

+ 0 - 1
pom.xml

@@ -57,7 +57,6 @@
         <java.version>1.8</java.version>
         <!--当前程序兼容 jpom 最新版本号-->
         <jpom-min-version>2.10.0</jpom-min-version>
-        <spring-boot.version>2.7.10</spring-boot.version>
 
         <!-- 跳过测试 -->
         <skipTests>true</skipTests>

+ 2 - 1
web-vue/src/assets/reset.less

@@ -1,7 +1,8 @@
 /* 全局样式,重置样式 */
 html,
 body {
-  width: 100vw;
+  // 宽度 100vw 会出现横向滚动条
+  // width: 100vw;
   height: 100vh;
   margin: 0;
   padding: 0;

+ 9 - 0
web-vue/src/pages/layout/user-header.vue

@@ -18,6 +18,7 @@
                 }).name
               }}
             </template>
+            <template v-if="!this.inClusterUrl"><a-icon type="swap" @click="handleClusterChange(selectCluster)" /> </template>
           </a-tooltip>
         </div>
       </a-button>
@@ -463,6 +464,14 @@ export default {
         return temp;
       },
     },
+    inClusterUrl() {
+      const data = this.selectCluster;
+      if (!data || !data.url) {
+        // 没有配置集群地址
+        return true;
+      }
+      return window.location.href.indexOf(data && data.url) === 0;
+    },
   },
   inject: ["reload"],
   created() {