Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud App Engine - Edit 1 file

I am new at Google Cloud and I would like to know if there is a way to edit only one file inside of an App Engine application.

This is my problem: I am migrating from a normal hosting to google cloud and I am having some problems with my PHP code, I am using the same version like locally but I am getting some error in the cloud, so I need to change 1 or 2 files, update them and test the app, so is there any way to change that file directly on the server? To deploy i am using this command:

gcloud app deploy

But it takes about 10 minutes to deploy so is too slow my testing. Any suggestions?

Thanks. Leandro

like image 963
leandro2219 Avatar asked Jul 19 '18 21:07

leandro2219


2 Answers

For the standard environment the answer is no, you need to deploy a new version of the app to modify a file. So the advice would be - make the most of testing your app locally. See somehow related Google AppEngine - updating my webapp after deploy

For the flexible environment (possibly your case as you mentioned 10 min deployment time, typical for the flexible env) there might be stuff to try, but tedious, see Google AppEngine - updating my webapp after deploy

like image 136
Dan Cornilescu Avatar answered Sep 24 '22 11:09

Dan Cornilescu


There is a way to edit directly into the instance.

ssh into your instance and then start shell on your running docker as guided in this url. https://cloud.google.com/appengine/docs/flexible/python/debugging-an-instance

After login you can see your php source files.

Basically you will not have any editor. So do

$> apt update
$> apt install nano
$> nano index.php // edit your files

you can see something like

enter image description here

like image 37
Bala Avatar answered Sep 22 '22 11:09

Bala