创建一个对 Firebase Hosting 中新版本的部署敏感的云功能?

问题描述 投票:0回答:1

我正在尝试实现一个在新版本发布后(换句话说,一旦我的 Firebase 部署完成部署所有更改)就会触发的函数。 Firebase 支持这种可能性吗?我想在发布新版本后为我的应用程序启用实时更新。

// on new version release
exports.onHostingRelease = functions
  .runWith({ timeoutSeconds: 540, memory: '2GB' })
  .hosting.site('your-site-name')
  .onRelease((versionMetadata) => {
    // versionMetadata is an object that contains information about the new version
    console.log('New version deployed:', versionMetadata.versionString);

    // You can perform any actions you need here, such as sending a notification
    // or updating a database record

    return null;
  });

google-cloud-functions
1个回答
0
投票

所有支持的 Firebase 触发器都记录在文档左侧导航栏中的“触发器后台函数”部分,您可以在文档中看到。截至撰写本文时,Firebase 托管还没有触发器。

请随时向 Firebase 支持发送反馈以及您的功能请求。

© www.soinside.com 2019 - 2024. All rights reserved.