eve-local-dev-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEve Local Dev Loop (Docker Compose)
Eve本地开发流程(Docker Compose)
Use this skill to run and test the app locally with Docker Compose, then hand off to Eve for staging deploys.
使用本技能通过Docker Compose在本地运行和测试应用,然后过渡到Eve进行预发布环境部署。
Preconditions
前置条件
- A or
compose.yamlexists in the repo.docker-compose.yml - The Eve manifest () reflects the same services and ports.
.eve/manifest.yaml
- 仓库中存在或
compose.yaml文件。docker-compose.yml - Eve清单文件()中记录的服务和端口与Compose配置一致。
.eve/manifest.yaml
Local Run
本地运行
bash
undefinedbash
undefinedStart local services
启动本地服务
docker compose up --build
docker compose up --build
View logs
查看日志
docker compose logs -f
docker compose logs -f
Stop and clean
停止并清理
docker compose down -v
undefineddocker compose down -v
undefinedKeep Compose and Manifest in Sync
保持Compose与清单同步
- Match service names and exposed ports between Compose and the Eve manifest.
- If a service is public in production, set in the manifest.
x-eve.ingress.public: true - Use in the manifest and keep local values in
${secret.KEY}..eve/secrets.yaml
- 确保Compose配置和Eve清单中的服务名称与暴露端口一致。
- 如果某个服务在生产环境中是公开的,需在清单中设置。
x-eve.ingress.public: true - 在清单中使用,并将本地值存储在
${secret.KEY}中。.eve/secrets.yaml
Local Environment Variables
本地环境变量
- Prefer for Compose and
.envfor manifest interpolation..eve/secrets.yaml - Never commit secrets; keep in
.eve/secrets.yaml..gitignore
- 优先为Compose使用文件,为清单插值使用
.env。.eve/secrets.yaml - 切勿提交密钥;将加入
.eve/secrets.yaml。.gitignore
Promote to Staging
推广到预发布环境
bash
undefinedbash
undefinedEnsure profile and auth are set
确保已设置配置文件和认证
eve profile use staging
eve auth status
eve profile use staging
eve auth status
Set required secrets
设置所需密钥
eve secrets set API_KEY "value" --project proj_xxx
eve secrets set API_KEY "value" --project proj_xxx
Deploy to staging (requires --ref with 40-char SHA or a ref resolved against --repo-dir)
部署到预发布环境(需要--ref参数,值为40字符的SHA,或基于--repo-dir解析的引用)
eve env deploy staging --ref main --repo-dir .
eve env deploy staging --ref main --repo-dir .
If the environment has a pipeline configured, this triggers the pipeline.
如果环境已配置流水线,此命令将触发流水线。
Use --direct to bypass pipeline and deploy directly:
使用--direct参数绕过流水线直接部署:
eve env deploy staging --ref main --repo-dir . --direct
Track the deploy job:
```bash
eve job list --phase active
eve job follow <job-id>
eve job result <job-id>eve env deploy staging --ref main --repo-dir . --direct
跟踪部署任务:
```bash
eve job list --phase active
eve job follow <job-id>
eve job result <job-id>If Local Works but Staging Fails
若本地运行正常但预发布环境部署失败
- Re-check manifest parity with Compose.
- Verify secrets exist in Eve ().
eve secrets list - Use for failure details.
eve job diagnose <job-id>
- 重新检查清单与Compose配置的一致性。
- 验证Eve中是否存在对应的密钥()。
eve secrets list - 使用查看失败详情。
eve job diagnose <job-id>