deployment-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVercel Production Deploy Loop
Vercel生产部署循环
Instructions
操作说明
When requested to deploy to Vercel production with automatic error fixing:
-
Initial Deployment Attempt
- Run to start production deployment
vercel --prod - Wait for deployment to complete
- Run
-
Error Detection & Analysis
- CRITICAL: Use Vercel MCP tool to fetch detailed logs:
- The MCP logs provide much more detail than CLI output
- Analyze the build logs to identify root cause:
- Build errors (TypeScript, ESLint, compilation)
- Runtime errors
- Environment variable issues
- Dependency problems
- Configuration issues
- Extract specific error messages
- CRITICAL: Use Vercel MCP tool to fetch detailed logs:
-
Error Fixing
- Make minimal, targeted fixes to resolve the specific error
-
Retry Deployment
- Run again with the fixes applied
vercel --prod - Repeat steps until deployment succeeds
- Run
-
Success Confirmation
- Once deployment succeeds, report:
- Deployment URL
- All errors that were fixed
- Summary of changes made
- Ask if user wants to commit/push the fixes
- Once deployment succeeds, report:
当被要求部署至Vercel生产环境并自动修复错误时:
-
首次部署尝试
- 运行启动生产环境部署
vercel --prod - 等待部署完成
- 运行
-
错误检测与分析
- 关键步骤:使用Vercel MCP工具获取详细日志:
- MCP日志提供的细节远多于CLI输出
- 分析构建日志以确定根本原因:
- 构建错误(TypeScript、ESLint、编译问题)
- 运行时错误
- 环境变量问题
- 依赖项问题
- 配置问题
- 提取具体错误信息
- 关键步骤:使用Vercel MCP工具获取详细日志:
-
错误修复
- 进行最小化、针对性的修复以解决具体错误
-
重试部署
- 应用修复后再次运行
vercel --prod - 重复步骤直至部署成功
- 应用修复后再次运行
-
成功确认
- 部署成功后,汇报:
- 部署URL
- 已修复的所有错误
- 所做更改的摘要
- 询问用户是否需要提交/推送修复内容
- 部署成功后,汇报:
Loop Exit Conditions
循环终止条件
- ✅ Deployment succeeds
- ❌ SAME error occurs 5+ times (suggest manual intervention)
- ❌ User requests to stop
- ✅ 部署成功
- ❌ 相同错误出现5次及以上(建议手动干预)
- ❌ 用户要求停止
Best Practices
最佳实践
- Make incremental fixes rather than large refactors
- Preserve user's code style and patterns when fixing
- 采用增量修复而非大规模重构
- 修复时保留用户的代码风格与模式
Example Flow
示例流程
User: "Deploy to production and fix any errors"
- Vercel MCP build logs are the PRIMARY source of error information
- CLI output alone is insufficient for proper error diagnosis
- Always wait for deployment to complete before fetching logs
- If errors require user input (like API keys), prompt user immediately
用户: "部署至生产环境并修复所有错误"
- Vercel MCP构建日志是错误信息的主要来源
- 仅CLI输出不足以进行正确的错误诊断
- 始终等待部署完成后再获取日志
- 如果错误需要用户输入(如API密钥),立即提示用户