如何使用自定义 go build constraint/tag 部署 golang google 云函数?
How do you deploy a golang google cloud function with a custom go build constraint/tag?
我正在使用 go build constraints 有条件地将常量编译到我的 test/staging/production 云函数中。如何将 -tags ENV
传递给 gcloud beta functions deploy
使用的构建器?
正如@Guilherme 在评论中提到的,确实,似乎无法将 go
constraints/tags 传递给 Cloud Functions 使用的构建器。
我四处搜索,虽然没有这个选项,但我认为确实可以选择将约束发送到 Cloud Functions 使用的构建器。考虑到这一点,我建议您提出 Feature Request 以供 Google 检查。
您可能想要查看的一个选项是使用云 运行 部署您的应用程序。正如他们在 official documentation 中关于此应用程序的通知:
Use the programming language of your choice, any language or operating system libraries, or even bring your own binaries.
Cloud Run pairs great with the container ecosystem: Cloud Build, Container Registry, Docker.
因此,这可能是一种解决方法。在下面的教程中,有在云中使用 Go 构建和部署快速应用程序的步骤 运行。
如果这些信息对您有帮助,请告诉我!
我正在使用 go build constraints 有条件地将常量编译到我的 test/staging/production 云函数中。如何将 -tags ENV
传递给 gcloud beta functions deploy
使用的构建器?
正如@Guilherme 在评论中提到的,确实,似乎无法将 go
constraints/tags 传递给 Cloud Functions 使用的构建器。
我四处搜索,虽然没有这个选项,但我认为确实可以选择将约束发送到 Cloud Functions 使用的构建器。考虑到这一点,我建议您提出 Feature Request 以供 Google 检查。
您可能想要查看的一个选项是使用云 运行 部署您的应用程序。正如他们在 official documentation 中关于此应用程序的通知:
Use the programming language of your choice, any language or operating system libraries, or even bring your own binaries.
Cloud Run pairs great with the container ecosystem: Cloud Build, Container Registry, Docker.
因此,这可能是一种解决方法。在下面的教程中,有在云中使用 Go 构建和部署快速应用程序的步骤 运行。
如果这些信息对您有帮助,请告诉我!