Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Retrieve code of current version in App Engine (node JS in my case)

Adel62
New Member

Hi

Is there any solution to retrieve code of current version in App Engine ? Function (node JS) is running, how can we find the js file running in this current version ?

I tried gcloud app --project=$PROJECT versions describe --service=default "$version"  but no result : Error -> could not parse resource.

Thanks

0 1 715
1 REPLY 1

Hi @Adel62,

Welcome to Google Cloud Community!

As of the moment, you can only retrieve your source code if you deployed using App Engine Flex. You can follow the steps below on how to retrieve your code:

  1. Go to either App Engine Instances or VM Instances to display your App Engine Flex Instances.
  2. Click on the SSH button.
  3. Wait for the VM to load.
  4. Once it's loaded, type in sudo docker exec -t -i gaeapp /bin/bash. This will load your VM directory.
  5. Type ls to display the files. This will show the files that contain your source code.

I just type in cat [filename] to show the code then copy the source code.

You can also check out this Github link for alternative methods.

No method to retrieve the source code for App Engine Standard as of now. I would suggest to file this one as a feature request. We can't guarantee that this would be available in the future but you can keep track of its progress once the ticket has been created.

Hope these help.