Ver código fonte

Merge branch 'dev' of http://111.2.21.141:33001/ystl_myq/hospital-project into dev

haifeng.zhang 1 mês atrás
pai
commit
965039f426
4 arquivos alterados com 13 adições e 36 exclusões
  1. 0 1
      .dockerignore
  2. 2 16
      Dockerfile
  3. 10 18
      Jenkinsfile
  4. 1 1
      src/views/indexData/components/indexImport.vue

+ 0 - 1
.dockerignore

@@ -1,6 +1,5 @@
 node_modules
 .DS_Store
-dist
 dist-ssr
 *.local
 .eslintcache

+ 2 - 16
Dockerfile

@@ -1,20 +1,6 @@
-FROM node:18-alpine as build-stage
-
-WORKDIR /app
-RUN corepack enable
-RUN corepack prepare pnpm@8.6.10 --activate
-
-RUN npm config set registry https://registry.npmmirror.com
-
-COPY .npmrc package.json pnpm-lock.yaml ./
-RUN pnpm install --frozen-lockfile
-
-COPY . .
-RUN pnpm build
-
 FROM nginx:stable-alpine as production-stage
 
-COPY --from=build-stage /app/dist /usr/share/nginx/html
+COPY  /dist /usr/share/nginx/html
 EXPOSE 80
 
-CMD ["nginx", "-g", "daemon off;"]
+CMD ["nginx", "-g", "daemon off;"]

+ 10 - 18
Jenkinsfile

@@ -12,34 +12,26 @@ pipeline {
             steps {
                 // 从版本控制系统中检出代码
                 checkout scm
-            }
-        }
-     stage('Install pnpm') {
-            steps {
-                sh 'npm install -g pnpm'
-            }
-        }
-        stage('Install Dependencies') {
-            steps {
-                // 安装项目依赖
-                sh 'pnpm install'
+                            sh "pwd"
+                                sh "ls -la"
+                                sh "whoami"
             }
         }
 
         stage('Build') {
             steps {
-                // 构建Vue项目(开发环境)
-                sh 'npm run build:dev'
+                sh 'pnpm install && pnpm run build:dev'
+                sh 'ls -la'
+                     sh 'docker build --pull=false -t medicfornt .'
+
             }
         }
 
         stage('Publish Locally') {
             steps {
-               sh 'rm -rf /home/medic/dist'
-                // 将构建结果复制到本地目录(可自定义目录)
-                sh 'cp -r dist /home/medic'
-                // 解压dist.zip到指定目录
-                sh 'unzip /home/medic/dist.zip -d /home/medic/dist'
+               sh "docker stop medicfornt || true"
+               sh "docker rm medicfornt || true"
+               sh "docker run -d --name medicfornt -p 7889:80 medicfornt"
             }
         }
     }

+ 1 - 1
src/views/indexData/components/indexImport.vue

@@ -58,7 +58,7 @@ const handleUploadChange = async (file: File) => {
         <p class="text-xs mt-2 text">根据提升信息完善表格内容</p>
         <el-button class="mt-2">
           <el-icon> <Download /> </el-icon
-          ><a :href="backupUrl" download="指标导入模板.xlsx"
+          ><a :href="backupUrl" download="指标数据模板.xlsx"
             >下载空的模板表格</a
           >
         </el-button>