【问题标题】:Is it possible to quickly update the server.js file of a Node.js application running in the Google Cloud Platform?是否可以快速更新在 Google Cloud Platform 中运行的 Node.js 应用程序的 server.js 文件?
【发布时间】:2018-03-04 16:51:39
【问题描述】:

可以通过在终端中运行以下命令来更新在 Google Cloud Platform 中运行的服务的 app.yaml 或 dispatch.yaml:

gcloud app deploy dispatch.yaml

但是,当我将 dispatch.yaml 替换为 server.js 时,我收到以下消息:

ERROR: (gcloud.app.deploy) [path to the file] could not be identified as a valid source directory or file.

是重新完全部署应用程序的唯一方法吗?

【问题讨论】:

    标签: node.js google-app-engine google-cloud-platform gcloud


    【解决方案1】:

    gcloud app deploy 将 YAML 配置文件作为输入,以确定将更新应用程序配置的哪些方面。如果您指定gcloud app deploy app.yaml,该工具将部署您的应用程序的新版本。如果要覆盖现有版本,请使用gcloud app deploy app.yaml --version=NAMEOFCURRENTVERSION

    如果您需要上传更改的文件,则需要重新部署应用程序。很容易将 App Engine 视为标准的网络托管环境,但应用程序代码是容器化的,并且可能在多个运行实例中。您无权直接访问文件以进行直接编辑或替换等操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-09
      • 2021-07-17
      • 2023-03-09
      • 2022-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-23
      相关资源
      最近更新 更多