ln-730-devops-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseln-730-devops-setup
ln-730-devops-setup
Type: L2 Domain Coordinator
Category: 7XX Project Bootstrap
Parent: ln-700-project-bootstrap
Coordinates DevOps infrastructure setup by delegating to specialized workers.
类型: L2 领域协调器
分类: 7XX 项目初始化引导
父级: ln-700-project-bootstrap
通过委派给专业的工作组件来协调DevOps基础设施的搭建。
Purpose & Scope
目标与范围
Orchestrates the complete DevOps setup for a project:
- Does: Auto-detect stack, delegate to workers, verify configuration
- Does NOT: Generate files directly (delegates to ln-731, ln-732, ln-733)
编排项目的完整DevOps搭建流程:
- 负责内容:自动检测技术栈、委派给工作组件、验证配置
- 不负责内容:直接生成文件(委派给ln-731、ln-732、ln-733)
Overview
概述
| Aspect | Details |
|---|---|
| Input | Project directory with source code |
| Output | Docker, CI/CD, environment configuration |
| Workers | ln-731 (Docker), ln-732 (CI/CD), ln-733 (Environment) |
| Mode | Auto-detect (no user prompts) |
| 方面 | 详情 |
|---|---|
| 输入 | 包含源代码的项目目录 |
| 输出 | Docker、CI/CD、环境配置 |
| 工作组件 | ln-731(Docker)、ln-732(CI/CD)、ln-733(环境) |
| 模式 | 自动检测(无用户提示) |
Supported Stacks
支持的技术栈
| Component | Option 1 | Option 2 |
|---|---|---|
| Frontend | React/Vite + Nginx | - |
| Backend | .NET 8/9 | Python (FastAPI/Django) |
| Database | PostgreSQL | - |
| CI/CD | GitHub Actions | - |
| 组件 | 选项1 | 选项2 |
|---|---|---|
| 前端 | React/Vite + Nginx | - |
| 后端 | .NET 8/9 | Python(FastAPI/Django) |
| 数据库 | PostgreSQL | - |
| CI/CD | GitHub Actions | - |
Workflow
工作流程
Phase 1: Pre-flight Validation
阶段1:预启动验证
Check required tools and project structure:
- Verify Docker is installed ()
docker --version - Verify docker-compose is available
- Check for existing DevOps files (warn if overwriting)
Output: Validation report or STOP with instructions
检查所需工具和项目结构:
- 验证Docker已安装()
docker --version - 验证docker-compose可用
- 检查是否存在现有DevOps文件(若将覆盖则发出警告)
输出:验证报告或停止并给出操作说明
Phase 2: Project Analysis (Auto-detect)
阶段2:项目分析(自动检测)
Detect project stack automatically:
| Detection | Method | Files to Check |
|---|---|---|
| Frontend | Package.json presence | |
| Backend .NET | .csproj/.sln presence | |
| Backend Python | requirements.txt/pyproject.toml | |
| Database | Connection strings in code | |
| Existing CI/CD | Workflow files | |
Version Detection:
- Node.js: Read from engines or use
package.jsonnode -v - .NET: Read from TargetFramework
*.csproj - Python: Read from or
pyproject.tomlruntime.txt - PostgreSQL: Default to latest stable (17)
Output: Stack configuration object with detected versions
自动检测项目技术栈:
| 检测项 | 方法 | 需检查的文件 |
|---|---|---|
| 前端 | 检查是否存在Package.json | |
| 后端 .NET | 检查是否存在.csproj/.sln | |
| 后端 Python | 检查是否存在requirements.txt/pyproject.toml | |
| 数据库 | 检查代码中的连接字符串 | |
| 现有CI/CD | 检查工作流文件 | |
版本检测:
- Node.js: 从的engines字段读取,或使用
package.json获取node -v - .NET: 从的TargetFramework字段读取
*.csproj - Python: 从或
pyproject.toml读取runtime.txt - PostgreSQL: 默认使用最新稳定版(17)
输出: 包含检测到的版本的技术栈配置对象
Phase 3: Worker Delegation
阶段3:工作组件委派
Delegate to workers in parallel (independent tasks):
ln-730 (Coordinator)
|
+---> ln-731-docker-generator (via Task tool)
| Input: stack config, versions
| Output: Dockerfile.*, docker-compose.yml, .dockerignore
|
+---> ln-732-cicd-generator (via Task tool)
| Input: stack config, detected commands
| Output: .github/workflows/ci.yml
|
+---> ln-733-env-configurator (via Task tool)
Input: detected environment variables
Output: .env.example, .env.development, .gitignore updatesError Handling:
- If worker fails, log error and continue with others
- Report all failures at the end
- Suggest manual fixes for failed components
并行委派给工作组件(任务相互独立):
ln-730 (Coordinator)
|
+---> ln-731-docker-generator (via Task tool)
| Input: stack config, versions
| Output: Dockerfile.*, docker-compose.yml, .dockerignore
|
+---> ln-732-cicd-generator (via Task tool)
| Input: stack config, detected commands
| Output: .github/workflows/ci.yml
|
+---> ln-733-env-configurator (via Task tool)
Input: detected environment variables
Output: .env.example, .env.development, .gitignore updates错误处理:
- 若某个工作组件失败,记录错误并继续执行其他组件
- 在流程结束时报告所有失败情况
- 为失败的组件提供手动修复建议
Phase 4: Configuration Verification
阶段4:配置验证
Verify generated configuration:
- Run to validate syntax
docker-compose config - Check all referenced files exist
- Verify no secrets in committed files
Output: Verification report
验证生成的配置:
- 运行验证语法正确性
docker-compose config - 检查所有引用的文件是否存在
- 验证提交的文件中不包含敏感信息
输出: 验证报告
Phase 5: Completion Report
阶段5:完成报告
Generate summary:
- List all created files
- Show detected stack configuration
- Provide next steps for user
生成总结:
- 列出所有已创建的文件
- 展示检测到的技术栈配置
- 为用户提供后续步骤
Generated Files
生成的文件
Docker (ln-731)
Docker (ln-731)
- - Multi-stage build for frontend
Dockerfile.frontend - - Multi-stage build for backend
Dockerfile.backend - - Service orchestration
docker-compose.yml - - Development overrides (optional)
docker-compose.override.yml - - Build context exclusions
.dockerignore
- - 前端多阶段构建文件
Dockerfile.frontend - - 后端多阶段构建文件
Dockerfile.backend - - 服务编排文件
docker-compose.yml - - 开发环境覆盖配置(可选)
docker-compose.override.yml - - 构建上下文排除规则
.dockerignore
CI/CD (ln-732)
CI/CD (ln-732)
- - Main CI pipeline
.github/workflows/ci.yml
- - 主CI流水线文件
.github/workflows/ci.yml
Environment (ln-733)
环境 (ln-733)
- - Template with all variables
.env.example - - Development defaults
.env.development - - Production template (placeholders)
.env.production - updates - Secrets protection
.gitignore
- - 包含所有变量的模板文件
.env.example - - 开发环境默认配置
.env.development - - 生产环境模板(占位符)
.env.production - 更新 - 敏感信息保护
.gitignore
Critical Notes
重要说明
- Auto-detect Only: No interactive prompts. Uses detected values or sensible defaults.
- Idempotent: Check file existence before creation. Warn before overwriting.
- Parallel Execution: Workers are independent, can run in parallel.
- Error Recovery: Continue on partial failures, report all issues at end.
- Version Pinning: Use detected versions, not hardcoded values.
- 仅自动检测:无交互式提示,使用检测到的值或合理默认值。
- 幂等性:创建文件前检查是否已存在,覆盖前发出警告。
- 并行执行:工作组件相互独立,可并行运行。
- 错误恢复:部分失败时继续执行,在流程结束时报告所有问题。
- 版本固定:使用检测到的版本,而非硬编码值。
Definition of Done
完成标准
- Pre-flight validation passed
- Stack auto-detected successfully
- All workers completed (or failures documented)
- validates successfully
docker-compose config - No secrets in generated files
- Completion report displayed
Version: 1.1.0
Last Updated: 2026-01-10
- 预启动验证通过
- 技术栈自动检测成功
- 所有工作组件执行完成(或已记录失败情况)
- 验证通过
docker-compose config - 生成的文件中无敏感信息
- 显示完成报告
版本: 1.1.0
最后更新时间: 2026-01-10