- 只推送了latest版本,但是脚本里写的1.0.0
This commit is contained in:
38
.drone.yml
38
.drone.yml
@@ -18,7 +18,7 @@ clone:
|
|||||||
disable: true
|
disable: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 0️⃣ 克隆代码
|
# 0️⃣ 克隆代码(带自签证书)
|
||||||
- name: clone
|
- name: clone
|
||||||
image: alpine/git:latest
|
image: alpine/git:latest
|
||||||
environment:
|
environment:
|
||||||
@@ -36,12 +36,12 @@ steps:
|
|||||||
- name: repo-volume
|
- name: repo-volume
|
||||||
mountPath: /drone/src
|
mountPath: /drone/src
|
||||||
|
|
||||||
# 1️⃣ 准备环境
|
# 1️⃣ 准备环境(Node + pnpm)
|
||||||
- name: prepare-environment
|
- name: prepare-environment
|
||||||
image: gitea.local.knowai/tobegold574/knowai-base:1.0.0
|
image: gitea.local.knowai/tobegold574/knowai-base
|
||||||
commands:
|
commands:
|
||||||
- cd /drone/src/frontend/knowai-core
|
- cd /drone/src/frontend/knowai-core
|
||||||
- echo "🚀 验证 Node.js 环境..."
|
- echo "🚀 验证 Node.js 和 pnpm 环境..."
|
||||||
- node --version
|
- node --version
|
||||||
- pnpm --version
|
- pnpm --version
|
||||||
- echo "🔍 检查 pnpm 存储路径..."
|
- echo "🔍 检查 pnpm 存储路径..."
|
||||||
@@ -54,21 +54,21 @@ steps:
|
|||||||
|
|
||||||
# 2️⃣ 安装依赖
|
# 2️⃣ 安装依赖
|
||||||
- name: install-dependencies
|
- name: install-dependencies
|
||||||
image: gitea.local.knowai/tobegold574/knowai-base:1.0.0
|
image: gitea.local.knowai/tobegold574/knowai-base
|
||||||
commands:
|
commands:
|
||||||
- cd /drone/src/frontend/knowai-core
|
- cd /drone/src/frontend/knowai-core
|
||||||
- echo "📦 安装项目依赖..."
|
- echo "📦 安装依赖(利用缓存)..."
|
||||||
- pnpm install --registry=https://registry.npmmirror.com --no-frozen-lockfile
|
- pnpm install --frozen-lockfile --registry=https://registry.npmmirror.com
|
||||||
- echo "✅ 依赖安装完成"
|
- echo "✅ 依赖安装完成"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: repo-volume
|
- name: repo-volume
|
||||||
mountPath: /drone/src
|
mountPath: /drone/src
|
||||||
- name: pnpm_store_cache
|
- name: pnpm-store-cache
|
||||||
mountPath: /pnpm-global/store
|
mountPath: /pnpm-global/store
|
||||||
|
|
||||||
# 3️⃣ 类型检查
|
# 3️⃣ 类型检查
|
||||||
- name: type-check
|
- name: type-check
|
||||||
image: gitea.local.knowai/tobegold574/knowai-base:1.0.0
|
image: gitea.local.knowai/tobegold574/knowai-base
|
||||||
commands:
|
commands:
|
||||||
- cd /drone/src/frontend/knowai-core
|
- cd /drone/src/frontend/knowai-core
|
||||||
- echo "🔍 执行 TypeScript 类型检查..."
|
- echo "🔍 执行 TypeScript 类型检查..."
|
||||||
@@ -77,12 +77,12 @@ steps:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: repo-volume
|
- name: repo-volume
|
||||||
mountPath: /drone/src
|
mountPath: /drone/src
|
||||||
- name: pnpm_store_cache
|
- name: pnpm-store-cache
|
||||||
mountPath: /pnpm-global/store
|
mountPath: /pnpm-global/store
|
||||||
|
|
||||||
# 4️⃣ 代码检查
|
# 4️⃣ 代码检查 (Lint)
|
||||||
- name: lint
|
- name: lint
|
||||||
image: gitea.local.knowai/tobegold574/knowai-base:1.0.0
|
image: gitea.local.knowai/tobegold574/knowai-base
|
||||||
commands:
|
commands:
|
||||||
- cd /drone/src/frontend/knowai-core
|
- cd /drone/src/frontend/knowai-core
|
||||||
- echo "🔍 执行 ESLint 代码检查..."
|
- echo "🔍 执行 ESLint 代码检查..."
|
||||||
@@ -91,12 +91,12 @@ steps:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: repo-volume
|
- name: repo-volume
|
||||||
mountPath: /drone/src
|
mountPath: /drone/src
|
||||||
- name: pnpm_store_cache
|
- name: pnpm-store-cache
|
||||||
mountPath: /pnpm-global/store
|
mountPath: /pnpm-global/store
|
||||||
|
|
||||||
# 5️⃣ 运行测试
|
# 5️⃣ 运行测试
|
||||||
- name: test
|
- name: test
|
||||||
image: gitea.local.knowai/tobegold574/knowai-base:1.0.0
|
image: gitea.local.knowai/tobegold574/knowai-base
|
||||||
commands:
|
commands:
|
||||||
- cd /drone/src/frontend/knowai-core
|
- cd /drone/src/frontend/knowai-core
|
||||||
- echo "🧪 运行单元测试..."
|
- echo "🧪 运行单元测试..."
|
||||||
@@ -105,21 +105,21 @@ steps:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: repo-volume
|
- name: repo-volume
|
||||||
mountPath: /drone/src
|
mountPath: /drone/src
|
||||||
- name: pnpm_store_cache
|
- name: pnpm-store-cache
|
||||||
mountPath: /pnpm-global/store
|
mountPath: /pnpm-global/store
|
||||||
|
|
||||||
# 6️⃣ 构建验证
|
# 6️⃣ 构建验证
|
||||||
- name: build
|
- name: build
|
||||||
image: gitea.local.knowai/tobegold574/knowai-base:1.0.0
|
image: gitea.local.knowai/tobegold574/knowai-base
|
||||||
commands:
|
commands:
|
||||||
- cd /drone/src/frontend/knowai-core
|
- cd /drone/src/frontend/knowai-core
|
||||||
- echo "🔨 验证构建过程..."
|
- echo "🔨 构建产物..."
|
||||||
- pnpm run build
|
- pnpm run build
|
||||||
- echo "📁 检查构建产物..."
|
- echo "📁 构建产物列表:"
|
||||||
- ls -la dist/
|
- ls -la dist/
|
||||||
- echo "✅ 构建验证通过"
|
- echo "✅ 构建验证通过"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: repo-volume
|
- name: repo-volume
|
||||||
mountPath: /drone/src
|
mountPath: /drone/src
|
||||||
- name: pnpm_store_cache
|
- name: pnpm-store-cache
|
||||||
mountPath: /pnpm-global/store
|
mountPath: /pnpm-global/store
|
||||||
|
|||||||
Reference in New Issue
Block a user