zeabur-update-service

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zeabur Update Service Without Redeploy

无需重新部署即可更新Zeabur服务

Workflow

操作流程

bash
undefined
bash
undefined

1. Set project context

1. 设置项目上下文

npx zeabur@latest context set project --id=<project-id> -i=false -y
npx zeabur@latest context set project --id=<project-id> -i=false -y

2. Get service ID

2. 获取服务ID

npx zeabur@latest service list -i=false
npx zeabur@latest service list -i=false

3. Check current variables

3. 查看当前变量

npx zeabur@latest variable list --id <service-id> -i=false
npx zeabur@latest variable list --id <service-id> -i=false

4. Add/update variables

4. 添加/更新变量

npx zeabur@latest variable create --id <service-id>
--key "KEY1=value1"
--key "KEY2=value2"
-i=false -y
npx zeabur@latest variable create --id <service-id>
--key "KEY1=value1"
--key "KEY2=value2"
-i=false -y

5. Get env-id (from step 3 output or deployment list)

5. 获取环境ID(来自步骤3的输出或部署列表)

Look for: "Only one environment... select <production>"

查找:“Only one environment... select <production>”(仅一个环境...选择<production>

6. Restart service

6. 重启服务

npx zeabur@latest service restart --id <service-id> --env-id <env-id> -i=false -y
undefined
npx zeabur@latest service restart --id <service-id> --env-id <env-id> -i=false -y
undefined

Caveats

注意事项

IssueSolution
${VAR}
references
Set in Dashboard, not CLI (shell expands to empty)
variable update
clears vars
Use
variable create
instead
Need env-idGet from
variable list
output or Dashboard URL
问题解决方案
${VAR}
引用
在控制台中设置,不要使用CLI(Shell会将其展开为空值)
variable update
会清空变量
改用
variable create
命令
需要环境ID
variable list
的输出或控制台URL中获取

When to Use

使用场景

  • Fix environment variable typos
  • Add missing config
  • Change ports, URLs, credentials
  • No need to redeploy entire template
  • 修复环境变量的输入错误
  • 添加缺失的配置项
  • 修改端口、URL、凭证信息
  • 无需重新部署整个模板