如何编辑 App.Yaml(Google 云平台)

How to Edit App.Yaml (Google Cloud Platform)

我已准备好部署到 Google 云平台,但我 运行 遇到了问题。该网站不会部署。以下是代码显示的内容:

ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/home/jinthemix/app.yaml]
Unexpected attribute 'pi_version' for object of type AppInfoExternal.
  in "/home/jinthemix/app.yaml", line 1, column 13

下面是 app.yaml。我使用 vim app.yaml 进入代码。我很困惑为什么它看起来与我想使用的代码不同。所以我想知道如何编辑 app.yaml 以便部署。

这是我要使用的代码:

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /(.*)
  static_files: www/
  upload: www/(.*)

(旁注:我将如何 link index.html?(当有人导航到您网站的根页面时,此人在单击或转到 link 的站点)) 这是 html 所在的位置:

jinthemix@cloudshell:~ (website-deploying-gc)$ ls
app.yaml  IMD233  Files  README-cloudshell.txt  README.md  www
jinthemix@cloudshell:~ (website-deploying-gc)$ cd www
jinthemix@cloudshell:~/www (website-deploying-gc)$ ls
Mixs
jinthemix@cloudshell:~/www (website-deploying-gc)$ cd Mixs
jinthemix@cloudshell:~/www/Mixs (website-deploying-gc)$ ls
'Mix 1 (1)'  'Mix 2 (2)'  'Mix 3 (3)'  'Mix 4 (4)'
jinthemix@cloudshell:~/www/Mixs (website-deploying-gc)$ cd 'Mix (1)'
jinthemix@cloudshell:~/www/Mixs/Mix 1 (1) (website-deploying-gc)$ ls
'hello.html (B) (L2).html'  'hello.html (T) (L3).html'  'hello (L1).html'
jinthemix@cloudshell:~/www/Mixs/Mix 1 (1) (website-deploying-gc)$ cd
jinthemix@cloudshell:~ (website-deploying-gc)$ cd

一般来说,您可以使用任何可以读取 YAML files 的文本编辑器程序来编辑任何 app.yaml 个文件。

我看到您正在使用云 Shell 来部署您的应用程序。

您可以使用 UNIX 支持的任何文本编辑器(例如 vim or nano)并通过 运行 每个程序用来打开和保存编辑文件的相关命令从终端编辑文件。

如果您发现从终端使用上述任何程序具有挑战性并且更喜欢更直观友好的界面,请按照 docs 中提到的步骤(基本上只需单击 Cloud Shell 上的“打开编辑器”按钮,找到文件并像使用记事本一样进行编辑。