How do I download a specific service's source code off of AppEngine?
Asked Answered
M

4

2

I have some php source code working in an app engine production environment that won't work anywhere else. Old versions of that code don't seem to work at all either so I need to get that source and see what the heck it is doing differently.

This discussion outlines the challenges I'm having: http://google-app-engine.75637.x6.nabble.com/Download-specific-Module-code-td699.html

I was told to try using appcfg.py download_app:

appcfg.py download_app -A <APP_NAME> -V <Version> <DIR>

The problem is that this command does not allow me to specify module / service so I can't target my source code. Also I'm not the App owner so I can't download everything but from what I understand that still wouldn't work because appcfg only seems to target the default service.

The article I linked ends with a suggestion to use gcloud to download the app but I haven't been able to find how to do that. Does anyone here know how to resolve this? The service is running in a Flexible instance - not sure if that makes a difference...

Melda answered 30/8, 2016 at 23:47 Comment(0)
A
2

From appcfg.py download_app --help:

Usage: appcfg.py [options] download_app -A app_id [ -V version ]

...

-M MODULE, --module=MODULE Set the module, overriding the module value from app.yaml. ...

This invocation allowed me to download the code for the non-default python module of :

appcfg.py --module=<my_module> download_app -A <my_app> .

Of course, you need to meet authentication and ownership requirements, etc. And your app shouldn't have been configured for prevention of source code downloads (ireversible config)

Azpurua answered 31/8, 2016 at 0:7 Comment(0)
H
1

Simple enough to do:

  1. Switch to the directory where App Engine is installed on your computer. It is usually under the following path:

    C:\Program Files\Google\google_appengine

  2. Run the below command

    appcfg.py download_app –A MyAppName -V 1 c:\AppEngine\SourceCode

Huynh answered 1/9, 2016 at 21:11 Comment(0)
C
1

Solution:

appcfg.py -A [YOUR_PROJECT_ID] --module=[YOUR_PROJECT_MODULE] download_app [SAVE_FOLDER]

Example:

appcfg.py -A foo-project --module=01-01.foo-project.appspot.com download_app foo-project-v0101
Clermontferrand answered 9/6, 2017 at 13:28 Comment(0)
R
0

Posting this since none of the listed methods on the web didn't take me to the code (by June 2021)

You could try accessing your source code through;

Google Cloud Platform > Debugger > choosing the version of the Application from combo at top.

This will list the files of that version on the left pane. There is no way to download it automatically but you can copy-paste the code.

Hope you will find this helpful.

Rhenium answered 1/7, 2021 at 4:14 Comment(1)
appcfg.py is deprecated by google cloud.google.com/appengine/docs/standard/python/tools/…Rhenium

© 2022 - 2024 — McMap. All rights reserved.