Global Rationality
Global Rationality

Reputation: 145

Is it possible to quickly update the server.js file of a Node.js application running in the Google Cloud Platform?

It is possible to update app.yaml or dispatch.yaml for services running in Google Cloud Platform by running the following in the terminal:

gcloud app deploy dispatch.yaml

However, when I replace dispatch.yaml with server.js, I get the following message:

ERROR: (gcloud.app.deploy) [path to the file] could not be identified as a valid source directory or file.

Is the only way to deploy the application completely again?

Upvotes: 0

Views: 128

Answers (1)

BrettJ
BrettJ

Reputation: 6841

The gcloud app deploy takes YAML configuration files as input for determining what aspects of your application's configuration will be updated. If you specify gcloud app deploy app.yaml, the tool will deploy a new version of your app. If you want to override an existing version, then use gcloud app deploy app.yaml --version=NAMEOFCURRENTVERSION

If you need to upload changed files, you need to redeploy the app. Its tempting to think of App Engine like a standard web hosting environment, but the application code is containerized and possibly in multiple running instances. You don't have direct access to the files for things like direct editing or replacement.

Upvotes: 2

Related Questions