zeabur-update-service
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZeabur Update Service Without Redeploy
无需重新部署即可更新Zeabur服务
Workflow
操作流程
bash
undefinedbash
undefined1. 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
--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
--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
undefinednpx zeabur@latest service restart --id <service-id> --env-id <env-id> -i=false -y
undefinedCaveats
注意事项
| Issue | Solution |
|---|---|
| Set in Dashboard, not CLI (shell expands to empty) |
| Use |
| Need env-id | Get from |
| 问题 | 解决方案 |
|---|---|
| 在控制台中设置,不要使用CLI(Shell会将其展开为空值) |
| 改用 |
| 需要环境ID | 从 |
When to Use
使用场景
- Fix environment variable typos
- Add missing config
- Change ports, URLs, credentials
- No need to redeploy entire template
- 修复环境变量的输入错误
- 添加缺失的配置项
- 修改端口、URL、凭证信息
- 无需重新部署整个模板