Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

deployment - How to Edit App.Yaml (Google Cloud Platform)

I am ready to deploy into the Google Cloud Platform but I have ran into a problem. The website won't deploy. Here is what the code displays:

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

Down below here is the app.yaml. I used vim app.yaml to get into the code. I am confused as to why it looks different from the code I wanted to use. So I am wondering how I can edit app.yaml so I can deploy.

I can't upload the code directly, can't copy and paste

This is the code I want to use:

runtime: python27
api_version: 1
threadsafe: true

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

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

(side note: How would I link the index.html? (when someone navigates to the root page of your website, what the person sees when clicking or going to the link of the site)) Here is where the html is located:

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
question from:https://stackoverflow.com/questions/65855477/how-to-edit-app-yaml-google-cloud-platform

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In general you could use any text editor program that can read YAML files to edit any app.yaml files.

I see you are using the Cloud Shell to deploy your application.

You could use any text editor supported by UNIX (e.g. vim or nano) and edit the file from the terminal by running the relevant commands each program uses to open and then save the edited file.

If you find using any of the above programs from the terminal challenging and prefer a more visual friendly interface take advantage of the Cloud Shell Editor by following the steps mentioned on the docs (basically just click on the Open editor button on the Cloud Shell, locate the file and edit it as if you were using Notepad).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...