Rap*_*ael 5 google-cloud-storage google-cloud-platform
尝试使用以下命令将 Python 项目部署到 Google Cloud 函数时
\ngcloud functions deploy my_function --entry-point reply --runtime python38 --trigger-http --allow-unauthenticated
我明白了
\n\n\n正在部署函数(可能需要一段时间 - 最多 2 分钟)...\xe2\xa0\x9b
\n
\n有关 Cloud Build Stackdriver 日志,请访问:\nhttps://[...]\n正在部署函数(可能需要一段时间 -最多 2 分钟)...失败。
\n错误:(gcloud.functions.deploy) 操作错误:代码 = 3,消息 = 构建\n失败:缺少 main.py 且未指定 GOOGLE_FUNCTION_SOURCE。\n请在 main.py 中创建该函数,或指定\nGOOGLE_FUNCTION_SOURCE 指向该文件包含\n函数;错误 ID:5c04ec9c
main.py但我的文件夹里确实有一个文件。
我检查了平台,文件main.py没有上传,而文件夹内的文件正在上传。
解决方案是从以下位置省略这一行.gcloudignore:
#!include:.gitignore
Run Code Online (Sandbox Code Playgroud)
我真的不明白为什么。
我的.gitignore是:
.*
*.json
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11171 次 |
| 最近记录: |