【问题标题】:Deploying a Google Cloud Function written in typescript部署用 typescript 编写的 Google Cloud 函数
【发布时间】:2022-01-08 14:09:58
【问题描述】:

我使用 typescript 和 @google-cloud/functions-framework 编写了一个云函数。我目前的工作流程是npm installtsc(打字稿编译),然后是functions-framework --source=build/src/ --target=index。然后我可以访问http://localhost:8080/ 来运行我的函数。

在 GCP 上镜像我的 GitHub 存储库后,如何获取我的代码来构建和重新部署未来的提交?

【问题讨论】:

  • 嗨@abc,我的回答对你有帮助吗?
  • Idk 我决定只使用 firebase 函数

标签: typescript google-cloud-platform google-cloud-functions google-cloud-build


【解决方案1】:

要从源代码库部署函数,请使用以下命令:

gcloud functions deploy NAME \
  --source https://source.developers.google.com/projects/PROJECT_ID/repos/REPOSITORY_ID/moveable-aliases/master/paths/SOURCE \
  --runtime RUNTIME \
  TRIGGER... \
  [FLAGS...]

有关这方面的更多信息,请查看文档here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-07
    • 1970-01-01
    • 2020-01-19
    • 1970-01-01
    • 2018-08-11
    • 1970-01-01
    • 2020-02-01
    • 1970-01-01
    相关资源
    最近更新 更多