Files
knowai/.drone.yml
tobegold574 bafff468a9
Some checks reported errors
continuous-integration/drone/push Build encountered an error
fix(CI): 修改.drone.yml中type字段,调用集群runner
2025-11-02 20:53:43 +08:00

67 lines
1.7 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: kubernetes
name: verify-nuxt-config
trigger:
branch:
- architecture-nuxt3
event:
- push
environment:
NUXT_PORT: 3000
HEALTH_CHECK_TIMEOUT: 30
volumes:
- name: node_modules_cache
host:
path: /tmp/drone/knowai-nuxt/node_modules
steps:
# 1⃣ 准备环境
- name: prepare-environment
image: gitea.local.knowai/tobegold574/knowai-nuxt-base:1.0.0
commands:
- echo "🚀 验证Nuxt基础环境..."
- node --version
- npm --version
- npx nuxt --version || true
# 2⃣ 安装依赖
- name: install-dependencies
image: gitea.local.knowai/tobegold574/knowai-nuxt-base:1.0.0
volumes:
- name: node_modules_cache
path: /app/node_modules
commands:
- echo "📦 安装项目依赖..."
- npm ci --prefer-offline --progress=false
- echo "✅ 依赖安装完成"
# 3⃣ 构建验证
- name: build-verification
image: gitea.local.knowai/tobegold574/knowai-nuxt-base:1.0.0
volumes:
- name: node_modules_cache
path: /app/node_modules
commands:
- echo "🔨 验证构建过程..."
- npm run build
- echo "✅ 构建验证通过"
# 4⃣ 启动服务并检查运行状态
- name: service-start-check
image: gitea.local.knowai/tobegold574/knowai-nuxt-base:1.0.0
volumes:
- name: node_modules_cache
path: /app/node_modules
commands:
- echo "🌐 启动 Nuxt 服务..."
- npm run start &
- sleep 10
- |
if ps aux | grep -v grep | grep "nuxt" > /dev/null; then
echo "✅ Nuxt 服务启动成功"
else
echo "❌ Nuxt 服务启动失败"