3

I am trying to debug an application I have deployed to google cloud app engine. Reading the docs, I figured out that in order to do so I have to enter the debug mode using

gcloud app --project [Project ID] instances enable-debug

afterwards I am able to SSH into my instance and access root. Now I would like to edit some of the files. However, trying to use vim or nano does not seem to work.

Is there a way to edit those files without re-deploying the entire app?

AaronDT
  • 3,940
  • 8
  • 31
  • 71
  • Similar to @paing answer. Detailed steps in this answer https://stackoverflow.com/a/52846714/2179456 – Bala Oct 17 '18 at 03:07

2 Answers2

2

Once you SSH into the App Engine instance and open a shell into the Docker container, you'll need to download the package list before installing nano or vim:

apt-get update && apt-get install nano

Then you can edit your app's files (which are in /app):

nano composer.json
paing
  • 81
  • 5
1

The deployed app runs live code. It is not generally feasible to edit it. Moreover, changes made to the running container are not permanent; in fact they and are lost at the first re-start. You may find some information on the Debugging an Instance page. Unrelated to the above, an actual command-line editor is offered in the cloud shell.

George
  • 1,488
  • 1
  • 10
  • 13