Skip to main content

npx remotion cloudrun sites

EXPERIMENTAL

Cloud Run 处于 Alpha 阶段,这意味着 API 可能会在任何版本中更改,文档尚未完成。请查看 更改日志以了解最新的重大更改。

npx remotion cloudrun sites 命令允许在您的 Cloud 存储桶中创建、查看和删除 Remotion 项目。

create​

bash
npx remotion cloudrun sites create <entry-point>?
bash
npx remotion cloudrun sites create <entry-point>?

您可以将 入口点 作为第一个参数传递,否则入口点将被 确定。

将 Remotion 视频捆绑并上传到 Cloud 存储桶。

结果将是一个 URL,例如 https://storage.googleapis.com/remotioncloudrun-12345/sites/mySite123/index.html。

note

如果您在本地进行更改,需要重新部署站点。使用 --site-name 来覆盖现有站点。

您可以使用此 "Serve URL" 在 Remotion Cloud Run 上渲染视频:

如果您在 Cloud Run 上进行渲染,还可以将站点名称(在本例中为 mySite123)作为缩写传递。

--region​

选择的 GCP 区域。访问站点的服务也应在相同的区域中,以最小化延迟。

--site-name​

将项目上传到特定目录并返回确定性 URL。如果在相同区域下已存在具有此名称的站点,则将其覆盖。只能包含以下字符:0-9、a-z、A-Z、-、!、_、.、*、'、(、)

npx remotion cloudrun sites create src/index.ts --site-name=another-site
npx remotion cloudrun sites create src/index.ts --site-name=another-site

--disable-git-sourcev4.0.182​

Disables the Git Source being connected to the Remotion Studio. Clicking on stack traces and certain menu items will be disabled.

ls​

npx remotion cloudrun sites ls
npx remotion cloudrun sites ls

获取站点列表。打印的 URL 可以传递给 render 命令以渲染视频。

示例输出

2 个站点位于 us-east1,在 remotion-example 项目中。



站点: another-site


存储桶: remotioncloudrun-12345


区域: us-east1


服务 URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html



站点: test-site


存储桶: remotioncloudrun-12345


区域: us-east1


服务 URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html


--region​

GCP 区域 以列出站点。

--all-regions,​

忽略区域,返回项目中所有区域的站点。

npx remotion cloudrun sites ls --all-regions
npx remotion cloudrun sites ls --all-regions
示例输出

3 个站点位于所有区域,在 remotion-example 项目中。



站点: another-site


存储桶: remotioncloudrun-12345


区域: us-east1


服务 URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html



站点: test-site


存储桶: remotioncloudrun-12345


区域: us-east1


服务 URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html



站点: central-site


存储桶: remotioncloudrun-abcdefgh


区域: us-central1


服务 URL: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html

--quiet, -q​

仅返回以空格分隔的站点列表。```

npx remotion cloudrun sites ls -q
npx remotion cloudrun sites ls -q
示例输出

another-site test-site central-site


rm​

通过ID从Cloud Storage中删除一个或多个站点。

bash
npx remotion cloudrun sites rm central-site
npx remotion cloudrun sites rm central-site another-site # 一次删除多个
bash
npx remotion cloudrun sites rm central-site
npx remotion cloudrun sites rm central-site another-site # 一次删除多个
示例输出

站点:central-site


存储桶:remotioncloudrun-abcdefgh


区域:us-central1


服务网址: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html



删除?(Y/n)Y
从存储桶remotioncloudrun-abcdefgh中删除了站点central-site。


--region​

要从中删除站点的GCP区域。

note

rm命令不支持--all-regions标志,因为可能在多个区域中具有相同的站点名称。这使得从多个区域中删除多个站点名称变得困难。

--yes,-y​

删除一个或多个站点而无需确认。

npx remotion cloudrun sites rm central-site -y
npx remotion cloudrun sites rm central-site -y

rmall​

删除所选GCP项目中的所有站点。

bash
npx remotion cloudrun sites rmall
bash
npx remotion cloudrun sites rmall
示例输出

检索us-east1中的站点。



站点:another-site


存储桶:remotioncloudrun-12345


区域:us-east1


服务网址:https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html



删除?(Y/n)n
跳过站点 - another-site。




站点:test-site


存储桶:remotioncloudrun-12345


区域:us-east1


服务网址:https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html



删除?(Y/n)n
跳过站点 - test-site。

--region​

删除所有站点的 GCP 区域。

--all-regions,​

忽略区域,删除项目中所有区域的站点。

npx remotion cloudrun sites rmall --all-regions
npx remotion cloudrun sites rmall --all-regions
示例输出

检索所有区域的站点。



站点: another-site


存储桶: remotioncloudrun-12345


区域: us-east1


服务 URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html



删除?(Y/n) n
跳过站点 - another-site。




站点: test-site


存储桶: remotioncloudrun-12345


区域: us-east1


服务 URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html



删除?(Y/n) n
跳过站点 - test-site。




站点: central-site


存储桶: remotioncloudrun-abcdefgh


区域: us-central1


服务 URL: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html



删除?(Y/n) n
跳过站点 - central-site。

--yes, -y​

无需确认即可删除所有站点。

npx remotion cloudrun sites rmall -y
npx remotion cloudrun sites rmall -y