代码之家  ›  专栏  ›  技术社区  ›  cozimo

谷歌云警告:自动应用检测已被弃用,并将很快被删除

  •  0
  • cozimo  · 技术社区  · 6 年前

    我正在尝试将一个nodejs项目部署到Google Cloud,在进入gcloud app deploy后,在Google Cloud SDK外壳中出现以下错误。 在部署之前,我已经完成了以下工作。(我在引号中概述了这些步骤,因为下面的代码存在一些奇怪的格式问题,它实际上没有从任何地方引用)。非常感谢!

    1. 在谷歌云上创建了一个项目
    2. 创建应用程序。yaml与我的应用程序位于同一文件夹中。js。我为应用程序指定了runtime:nodejs和env:flex。亚马尔
    3. 我将端口设置为8080,并在包中添加了“start”:“node app.js”。json
    4. 我打开Google Cloud SDK外壳,然后输入:gcloud auth login。然后我进入gcloud config set项目并输入我的项目ID。 然后我进入:gcloud app deploy。
    WARNING: Automatic app detection is deprecated and will soon be removed. 
    As an alternative, create an app.yaml file yourself using the directions at 
    https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-
    with-app-yaml (App Engine Flexible Environment) or 
    https://cloud.google.com/appengine/docs/standard/python/config/appref (App 
    Engine Standard Environment) under the tab for your language.
    Deployment to Google App Engine requires an app.yaml file. This
    command will run `gcloud beta app gen-config` to generate an app.yaml for you in 
    the current directory (if the current directory does not contain an App Engine 
    service, please answer "no").
    
    2 回复  |  直到 6 年前
        1
  •  0
  •   Dan Cornilescu    6 年前

    这个 gcloud app deploy 您使用的部署命令未指定 app.yaml 对于要部署的服务。根据调用上下文/环境,检测(或生成)文件的自动逻辑并不总是产生用户可能期望的结果,因此会发出警告。

    解决方法(以及一般建议)是始终在部署命令中指定文件(而不是依赖非100%可靠的自动检测/生成),如下所示:

    gcloud app deploy [path_to/]app.yaml
    
        2
  •  0
  •   cozimo    6 年前

    我通过将文件提交到本地存储库来修复它。我真的不知道为什么,但这是我唯一改变的事情,它起了作用。