将此目录部署为 App Engine 应用程序需要 app.yaml或 appengine-web.xml文件

问题描述

这是我第一次在云上部署东西,我关注了这篇文章

我已经创建了应用程序,并希望将其部署到 Google Cloud 上。在执行此操作时,我收到 app.yaml 文件错误

enter image description here

enter image description here

我的 app.yaml 是,

enter image description here

当我执行“ls”命令时,它只显示1个文件

enter image description here

解决方法

问题是命令 gcloud app deploy 无法找到您的应用程序 app.yaml 文件。

如果您不向 gcloud app deploy 提供任何参数,它将在当前目录中查找 app.yaml 文件。

从您的屏幕截图来看,您似乎位于 Cloud Shell 主目录中,该目录位于包含您的代码和实际 app.yaml 文件(名为 xxxx-point-gcp 的文件)的目录上方。

请将工作目录更改为 xxxx-point-gcp,然后运行 ​​gcloud app deploy,或者运行 gcloud app deploy,将 app.yaml 文件的完整路径作为参数传递:

gcloud app deploy ~/xxxx-point-gcp/app.yaml

请用 xxxx 占位符替换适当的路径。

请参阅relevant documentation

,

您需要从包含 gcloud app deploy 文件的文件夹中运行 app.yaml