Files
knowai/.drone.yml
tobegold574 28a2ccb3fb
Some checks reported errors
continuous-integration/drone/push Build was killed
feat(project): 创建基础项目架构,上传基础架构文件
feat(CI): 提供.drone.yml,可以用于对后续更新配置文件做CI验证

feat(image): 完成镜像搭建knowai-nuxt-base:1.0.0,上传对应Dockerfile
2025-11-02 20:10:49 +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: docker
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 服务启动失败"