0
votes

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
1
1) The beginning of app.yaml is missing. Use vi to type in the missing part. Are you trying to say you do not know how to use vi? If yes, there are lots of getting started tutorials on the Internet. 2) Replace the last section of your question with the output from this command find . -print. That will create a clean listing of files and subdirectories. 3) Do not ask multiple questions in one post. Create one well defined question. Create separate posts for each question. - John Hanley
Appreciate the help. I guess I didn't realize that (about the added question), new to stack overflow. Any examples of using vi in the scenario provided in the question? - user15056935
Did you search for a tutorial on how to use vi? - John Hanley
I got a general idea: typing in vi app.yaml, type up the desired code, pressing (CTRL + O), then pressing :wq to save and quit. Hopefully afterwards, the deploy will work. - user15056935
Can you type up the code like a Word doc (like clicking on a specific sentence of code)? Also, where do I type "find . -print"? Inside the app.yaml? - user15056935

1 Answers

0
votes

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).