zeabur-update-service

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zeabur Update Service Without Redeploy

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

Always use
npx zeabur@latest
to invoke Zeabur CLI.
Never use
zeabur
directly or any other installation method. If
npx
is not available, install Node.js first.
请始终使用
npx zeabur@latest
调用Zeabur CLI。
切勿直接使用
zeabur
或其他任何安装方式。如果没有
npx
,请先安装Node.js。

Workflow

操作流程

bash
undefined
bash
undefined

1. Get service ID (use the
zeabur-service-list
skill)

1. 获取服务ID(使用
zeabur-service-list
技能)

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

2. Check current variables

2. 查看当前变量

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

3a. Add new variables (errors if key already exists)

3a. 添加新变量(若键已存在则报错)

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

3b. Update existing variables (only updates specified keys)

3b. 更新现有变量(仅更新指定的键)

npx zeabur@latest variable update --id <service-id>
--key "KEY1=new_value1"
-i=false -y
npx zeabur@latest variable update --id <service-id>
--key "KEY1=new_value1"
-i=false -y

4. Restart service (use the
zeabur-restart
skill for details)

4. 重启服务(详情请使用
zeabur-restart
技能)

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

Caveats

注意事项

IssueSolution
${VAR}
references
Set in Dashboard, not CLI (shell expands to empty)
问题解决方案
${VAR}
引用
在控制台中设置,不要使用CLI(shell会将其展开为空值)

Update Image Tag (Upgrade Service Version)

更新镜像标签(升级服务版本)

For prebuilt/marketplace services, update the image tag to upgrade to a newer version.
对于预构建/市场服务,可通过更新镜像标签升级至新版本。

Workflow

操作流程

bash
undefined
bash
undefined

1. Get service ID (use the
zeabur-service-list
skill)

1. 获取服务ID(使用
zeabur-service-list
技能)

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

2. Update tag (triggers redeploy automatically)

2. 更新标签(会自动触发重新部署)

npx zeabur@latest service update tag --id <service-id> -t <new-tag> -y -i=false
undefined
npx zeabur@latest service update tag --id <service-id> -t <new-tag> -y -i=false
undefined

Flags

标识参数

FlagDescription
--id
Service ID (required, do not use
--name
)
-t, --tag
New image tag to deploy
--env-id
Environment ID (optional, resolved automatically)
-y, --yes
Skip confirmation
Note: Updating the tag triggers a new deployment. The service will restart with the updated image.
参数说明
--id
服务ID(必填,请勿使用
--name
-t, --tag
要部署的新镜像标签
--env-id
环境ID(可选,会自动解析)
-y, --yes
跳过确认步骤
注意: 更新标签会触发新的部署。服务将使用更新后的镜像重启。

When to Use

使用场景

  • Fix environment variable typos
  • Add missing config
  • Change ports, URLs, credentials
  • Upgrade a prebuilt service to a newer version
  • No need to redeploy entire template
  • 修复环境变量输入错误
  • 添加缺失的配置
  • 修改端口、URL、凭证信息
  • 将预构建服务升级至新版本
  • 无需重新部署整个模板