leandro2219
leandro2219

Reputation: 93

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

Upvotes: 7

Views: 5434

Answers (3)

Bala
Bala

Reputation: 963

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

Upvotes: 6

Philipp Sh
Philipp Sh

Reputation: 997

There is no way to change 1-2 files on the server so that it would update the app. Deployment is the process of updating the live app. If you want some changes to be made to the app that is already deployed, you will have to redeploy - there is no way around it. This is why it is recommended to test the app locally before (re)deploying so that you are sure everything is working fine.

If locally everything works fine and issues start happening only when the app is deployed, this should be investigated further and I would advise you to open a new question and provide as much details as possible regarding the problems, including full stack trace of the error, related code parts, your app.yaml contents as well.

Upvotes: -1

Dan Cornilescu
Dan Cornilescu

Reputation: 39814

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

Upvotes: 6

Related Questions