升级 Cloud Run
Cloud Run 处于 Alpha 状态,且尚未积极开发。
- 从发布页面确定最新版本。
- 将所有软件包升级到最新版本(
@remotion/cloudrun,还有remotion、@remotion/cli等等)
- "@remotion/bundler": "4.0.0" + "@remotion/bundler": "4.0.1"- "@remotion/renderer": "4.0.0" + "@remotion/renderer": "4.0.1"- "@remotion/cloudrun": "4.0.0" + "@remotion/cloudrun": "4.0.1"- "remotion": "4.0.0" + "remotion": "4.0.1"
- (可选):删除服务的旧版本:
只有在服务不再使用时你才应这样做。如果你仍在生产中使用它,你可以直接跳过这一步。
npx remotion cloudrun services rmall -y- 部署 Remotion Cloud Run 服务的最新版本:
npx remotion cloudrun services deploy- 更新网站:
npx remotion cloudrun sites create src/index.ts --site-name=my-name传递 --site-name 以及现有站点的名称以更新它。网址将保持不变,但较旧的服务可能无法呈现更新后的站点。
🌐 Pass --site-name with the name of an existing site to update it. The URL will stay the same but older services may not be able to render the updated site.
如果你不传递 --site-name,将会生成一个新的站点 URL。你需要在你的 renderMediaOnCloudrun() 调用中更新 serveUrl 参数。已部署的旧服务仍然可以通过指定旧的服务 URL 来呈现。
🌐 If you don't pass --site-name a new site URL will be generated. You'll need to update the serveUrl parameter in your renderMediaOnCloudrun() calls. Old deployed services can still render by specifying the old serve URL.
将生产环境和测试环境分开
🌐 Separating production and testing environments
如果你已经将 Remotion Cloud Run 部署到生产环境,你可以在不产生任何停机的情况下进行升级:
🌐 If you already shipped Remotion Cloud Run to production, you can upgrade without incurring any downtime:
- 每个已部署的服务都有一个版本(使用
npx remotion cloudrun services ls查看它们)。使用相同版本的@remotion/cloudrun包来调用该函数。 - 你可以部署具有不同版本的多个服务。使用
compatibleOnly参数查找与@remotion/cloudrun包版本匹配的服务。 - Sites/
serveUrl' 也依赖于版本。请使用与渲染它们时相同版本的 Remotion 创建它们。如果没有不兼容的情况,Remotion 可以容忍版本不匹配,但会发出警告,提示你可能无法在打包的网站中获得所有最新功能和错误修复。