feat(project): 创建基础项目架构,上传基础架构文件
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
feat(CI): 提供.drone.yml,可以用于对后续更新配置文件做CI验证 feat(image): 完成镜像搭建knowai-nuxt-base:1.0.0,上传对应Dockerfile
This commit is contained in:
66
.drone.yml
Normal file
66
.drone.yml
Normal file
@@ -0,0 +1,66 @@
|
||||
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 服务启动失败"
|
||||
Reference in New Issue
Block a user