From 591bf9bff375a0901d35bddd7779ba7b9d06bab0 Mon Sep 17 00:00:00 2001 From: chenyuepan <3158614516@qq.com> Date: Thu, 3 Jul 2025 21:05:57 +0800 Subject: [PATCH] 2 --- .drone.yml | 20 ++++++++++++++------ .husky/_/.gitignore | 1 + 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2d59a03..f286cd8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: venue_reservation_manage steps: - name: prepare - image: node:18-alpine # 继续使用Node 18 + image: node:18-alpine volumes: - name: node-model path: /app/model @@ -13,11 +13,19 @@ steps: - name: node-build path: /app/build commands: - - npm install -g pnpm # 安装pnpm - - pnpm config set store-dir /app/model # 设置pnpm存储目录 - - pnpm config set registry https://registry.npmjs.org # 使用官方npm registry(更稳定) - - pnpm install --frozen-lockfile # 安装依赖(使用现有lockfile) - - pnpm run build # 构建项目 + - npm install -g pnpm + - pnpm config set store-dir /app/model + - pnpm config set registry https://registry.npmjs.org + + # 检查是否存在 pnpm-lock.yaml,不存在则生成 + - | + if [ ! -f "pnpm-lock.yaml" ]; then + echo "pnpm-lock.yaml 不存在,正在生成..." + pnpm install --lockfile-only + fi + + - pnpm install --frozen-lockfile + - pnpm run build - cp -r dist /app/build/ - cp Dockerfile /app/build/ - cp default.conf /app/build/ diff --git a/.husky/_/.gitignore b/.husky/_/.gitignore index e69de29..f59ec20 100644 --- a/.husky/_/.gitignore +++ b/.husky/_/.gitignore @@ -0,0 +1 @@ +* \ No newline at end of file