Browse Source

feat(components): drone update

Yi 3 days ago
parent
commit
1619ebe107

+ 2 - 2
.dockerignore

@@ -1,6 +1,6 @@
 node_modules
 .DS_Store
-.npmrc
+#.npmrc
 .cache
 
 tests/server/static
@@ -27,5 +27,5 @@ pnpm-debug.log*
 *.sln
 *.sw?
 yarn.lock
-pnpm-lock.yaml
+#pnpm-lock.yaml
 /vite-profile.cpuprofile

+ 13 - 12
.drone.yml

@@ -20,17 +20,17 @@ steps:
       repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-system-web
       registry: registry.cn-hangzhou.aliyuncs.com
       tags: [test]
-  - name: ssh commands
-    image: appleboy/drone-ssh
-    settings:
-      host: 192.168.1.70
-      username: tmrwatch
-      password:
-        from_secret: ssh_password
-      port: 22
-      script:
-        - cd /data/docker-compose/kpt-system-web/
-        - echo "123456" | ./restart.sh
+  #- name: ssh commands
+  #  image: appleboy/drone-ssh
+  #  settings:
+  #    host: 192.168.1.70
+  #    username: tmrwatch
+  #    password:
+  #      from_secret: ssh_password
+  #    port: 22
+  #    script:
+  #      - cd /data/docker-compose/kpt-system-web/
+  #      - echo "123456" | ./restart.sh
 trigger:
   branch:
     include:
@@ -68,11 +68,12 @@ steps:
       registry: registry.cn-hangzhou.aliyuncs.com
       tag:
         - latest
-        - ${DRONE_BRANCH##release/}
+        #- ${DRONE_BRANCH##release/}
 trigger:
   branch:
     include:
       - release/*
+      -  master
   event:
     include:
       - push

+ 38 - 13
Dockerfile

@@ -1,17 +1,42 @@
-FROM node:18.12-alpine as build
+FROM node:18-slim AS build
+
+# 设置工作目录和环境变量
 WORKDIR /app/kpt-system-web
 ENV NODE_OPTIONS="--max-old-space-size=4096"
-COPY . .
-RUN mkdir -p /root/.local/share/pnpm/store/v3/files && chown -R $(whoami) /root/.local/share/pnpm/store/v3/
-RUN npm install -g pnpm && npm install -g typescript@5.1.6
-RUN echo "declare module 'lodash-es';" > types.d.ts
-RUN pnpm config set registry https://registry.npmmirror.com
-RUN pnpm update vue-demi@latest
-RUN pnpm install --fetch-timeout 60000
-RUN pnpm build 
+ENV PNPM_HOME=/usr/local/bin
+ENV VITE_USER_NODE_ENV=production
 
-FROM nginx:alpine as prod
-WORKDIR /app/kpt-system-web
-COPY --from=build /app/kpt-system-web/dist/ /usr/share/nginx/html/
+# 安装系统依赖(改用 slim 镜像避免 Alpine 兼容性问题)
+RUN apt-get update && \
+    apt-get install -y git python3 make g++ jq && \
+    rm -rf /var/lib/apt/lists/*
+
+# 使用 Corepack 管理 PNPM
+RUN corepack enable && \
+    corepack prepare pnpm@latest --activate
+
+# 复制包管理文件(利用缓存层)
+COPY package.json pnpm-lock.yaml .npmrc ./
+COPY patches ./patches
+
+# 替换原有的安装和构建部分
+RUN pnpm install --shamefully-hoist && \
+    pnpm add \
+    vite@4.5.14 \
+    vite-plugin-mock@2.9.8 \
+    mockjs@1.1.0 \
+    @antfu/install-pkg@0.1.1 \
+    @iconify/utils@1.2.2 -D && \
+    # 强制锁定模块系统
+    jq '. + {"type": "commonjs"}' package.json > package.json.tmp && \
+    mv package.json.tmp package.json && \
+    # 清理缓存
+    rm -rf node_modules .pnpm-store && \
+    pnpm install --frozen-lockfile --ignore-scripts && \
+    pnpm build
+
+# 生产阶段
+FROM nginx:alpine AS prod
+COPY --from=build /app/kpt-system-web/dist /usr/share/nginx/html
 COPY --from=build /app/kpt-system-web/nginx.conf /etc/nginx/conf.d/default.conf
-EXPOSE 80
+EXPOSE 80

+ 2 - 0
build/plugins/mock.ts

@@ -2,6 +2,8 @@ import { viteMockServe } from 'vite-plugin-mock';
 
 export default viteMockServe({
   mockPath: 'mock',
+  localEnabled: false,
+  prodEnabled: false,
   injectCode: `
 		import { setupMockServer } from '../mock';
 		setupMockServer();

+ 6 - 0
package.json

@@ -134,5 +134,11 @@
   },
   "lint-staged": {
     "*.{js,jsx,mjs,json,ts,tsx,vue}": "eslint . --fix"
+  },
+  "type": "commonjs",
+  "resolutions": {
+    "package-manager-detector": "1.2.0",
+    "@antfu/install-pkg": "0.1.1",
+    "@iconify/utils": "1.2.2"
   }
 }

File diff suppressed because it is too large
+ 697 - 785
pnpm-lock.yaml


+ 1 - 1
src/service/request/index.ts

@@ -12,7 +12,7 @@ export const request = createRequest({
 export const mockRequest = createRequest({ baseURL: '/mock' });
 
 export const backgroundRequest = createRequest({
-  baseURL: 'http://122.114.177.195:8085/api/v1'
+  baseURL: 'http://210.16.186.252:8000/api/v1'
 });
 /* export const backgroundRequest = createRequest({ baseURL: 'http://192.168.1.96:8000/api/v1' });
  */

+ 1 - 1
src/views/auth-demo/super/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="h-full">
-    <n-card title="当前页面只有super才能看到" class="h-full shadow-sm rounded-16px"> </n-card>
+    <n-card title="当前页面只有super才能看到" class="h-full shadow-sm rounded-16px"></n-card>
   </div>
 </template>
 

+ 1 - 0
src/views/background/event/components/table-condition-modal.vue

@@ -124,6 +124,7 @@ interface Emits {
 
 const emit = defineEmits<Emits>();
 
+// eslint-disable-next-line vue/no-dupe-keys
 const conditionVisible = computed({
   get() {
     return props.conditionVisible;

+ 2 - 0
src/views/background/event/components/table-setting-modal.vue

@@ -208,6 +208,7 @@ const props = withDefaults(defineProps<Props>(), {
   editData: null
 });
 
+// eslint-disable-next-line vue/no-dupe-keys
 const settingVisible = computed({
   get() {
     return props.settingVisible;
@@ -243,6 +244,7 @@ function deleteData(row: RowField.Data) {
   console.log('==index=====', row);
 }
 
+// eslint-disable-next-line vue/no-dupe-keys
 function editData(row: RowField.Data) {
   console.log('==index=====', row);
 }

Some files were not shown because too many files changed in this diff