推出
了解如何使用推出机制逐步向用户部署更新。
推出允许你向部分用户推出更改,以在向所有用户发布更改之前捕获错误或其他问题。
🌐 A rollout allows you to roll out a change to a portion of your users to catch bugs or other issues before releasing that change to all your users.
EAS 根据你的使用情况提供 按更新和按分支的逐步发布机制。
🌐 EAS provides per-update and branch-based rollout mechanisms depending on your use case.
每次更新推出
🌐 Per-update rollouts
此推出机制允许你指定发布新更新时应接收新更新的用户百分比,然后逐渐增加该百分比。
🌐 This rollout mechanism allows you to specify a percentage of users that should receive a new update when you publish it, and then increase that percentage gradually afterwards.
启动
🌐 Starting
要开始基于更新的发布,请在常用的 eas update 命令中添加 --rollout-percentage 标志:
🌐 To start an update-based rollout, add the --rollout-percentage flag to your normal eas update command:
- eas update --rollout-percentage=10在此示例中,发布时,更新将仅对 10% 的终端用户可用。
🌐 In this example, when published, the update will only be available to 10% of your end users.
进行中
🌐 Progressing
要编辑基于更新的推出的百分比:
🌐 To edit the percentage of an update-based rollout:
- eas update:edit系统将引导你完成选择要编辑的更新的过程,并要求你输入新的百分比。
🌐 You will be guided through the process of selecting the update to edit and asked for the new percentage.
结束
🌐 Ending
在结束基于更新的发布时,你有两个选择:
🌐 When ending an update-based rollout, you have two options:
- 全面推出:为了实现这一最终目标,请按照上述方式推进推广,并将百分比设置为100。
- 恢复到先前状态:要做到这一点,运行
eas update:revert-update-rollout,它会引导你恢复到先前的状态。
附加说明
🌐 Additional notes
- 一次只能在分支上推出一个更新。
- 当部署正在进行时,必须使用上面的一种选项结束它,然后才能发布新的更新(使用相同的运行时版本)。这可以防止意外覆盖正在进行的部署。
- 要查看部署的状态,请使用
eas update:list或eas update:view命令。 - 在已有更新的分支上创建的部署回滚将会重新发布控制更新。这确保所有客户端都恢复到之前的状态。
- 可以在没有当前更新的分支上启动发布,在这种情况下,第一次更新将部署给指定比例的用户。撤销时,将创建一个回滚到内置更新的操作,这将使客户端恢复到之前的状态(内置更新)。
基于分支的推出
🌐 Branch-based rollouts
此推出机制允许你逐步将新分支上的一组更新推出给一定比例的终端用户,并将剩余比例的用户留在当前分支上。
🌐 This rollout mechanism allows you to incrementally roll out a set of updates on a new branch to a percentage of end users and leave the remaining percentage of users on the current branch.
启动
🌐 Starting
要启动基于分支的部署,请运行以下 EAS CLI 命令:
🌐 To start a branch-based rollout, run the following EAS CLI command:
- eas channel:rollout在终端中,会有一个交互式指南帮助你选择通道、选择发布的分支以及设置发布的用户百分比。要增加或减少发布量,请再次运行该命令,并选择 Edit 选项来调整发布百分比。
🌐 In the terminal, an interactive guide will assist you in selecting a channel, choosing a branch for the rollout, and setting the percentage of users for the rollout. To increase or decrease the rollout amount, run the command again and choose the Edit option to adjust the rollout percentage.
结束
🌐 Ending
在互动指南中选择 End 选项时,有两种方法可以结束部署:
🌐 Two methods are available to end a rollout when you choose the End option in the interactive guide:
- 重新发布并回滚: 当你对新分支的状态有信心时,请使用此选项。这将把新分支的最新更新重新发布到旧分支,所有用户将被指向旧分支。
- 恢复: 选择忽略新分支上的更新,并将用户返回到旧分支。
附加说明
🌐 Additional notes
- 一个通道上一次只能推出一个分支。
- 要查看部署的状态,请使用
eas channel:rollout命令。 - 当正在进行版本发布时,你可以通过运行
eas update --branch [branch]来向已发布和当前分支发布更新,例如。 eas update --channel [channel]无法在部署进行中使用,因为它无法知道应将更新与部署中的哪个分支关联。