eve-local-dev-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Eve 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
    compose.yaml
    or
    docker-compose.yml
    exists in the repo.
  • The Eve manifest (
    .eve/manifest.yaml
    ) reflects the same services and ports.
  • 仓库中存在
    compose.yaml
    docker-compose.yml
    文件。
  • Eve清单文件(
    .eve/manifest.yaml
    )中记录的服务和端口与Compose配置一致。

Local Run

本地运行

bash
undefined
bash
undefined

Start 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
undefined
docker compose down -v
undefined

Keep 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
    x-eve.ingress.public: true
    in the manifest.
  • Use
    ${secret.KEY}
    in the manifest and keep local values in
    .eve/secrets.yaml
    .
  • 确保Compose配置和Eve清单中的服务名称与暴露端口一致。
  • 如果某个服务在生产环境中是公开的,需在清单中设置
    x-eve.ingress.public: true
  • 在清单中使用
    ${secret.KEY}
    ,并将本地值存储在
    .eve/secrets.yaml
    中。

Local Environment Variables

本地环境变量

  • Prefer
    .env
    for Compose and
    .eve/secrets.yaml
    for manifest interpolation.
  • Never commit secrets; keep
    .eve/secrets.yaml
    in
    .gitignore
    .
  • 优先为Compose使用
    .env
    文件,为清单插值使用
    .eve/secrets.yaml
  • 切勿提交密钥;将
    .eve/secrets.yaml
    加入
    .gitignore

Promote to Staging

推广到预发布环境

bash
undefined
bash
undefined

Ensure 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
    eve job diagnose <job-id>
    for failure details.
  • 重新检查清单与Compose配置的一致性。
  • 验证Eve中是否存在对应的密钥(
    eve secrets list
    )。
  • 使用
    eve job diagnose <job-id>
    查看失败详情。