What are the alternatives to download source code from app engine instead of using appcfg.py
?

- 1,335
- 2
- 13
- 32

- 21
- 4
2 Answers
Yes, you are correct, downloading source code using appcfg.py
is deprecated. The alternative way is by downloading in Cloud Storage bucket named staging.project-id.appspot.com
but the name of the files are encrypted. For you to easy track the files use the following gcloud
command:
To view all versions and services in App Engine:
gcloud app versions list
Select the version ID and service name from the output then execute it in the gcloud command below:
gcloud app versions describe VERSIONID -s SERVICENAME
From the output, look for:
deployment:
files:
filesample.txt:
sha1Sum: encryptedname
sourceUrl: https://storage.googleapis.com/staging.project-id.appspot.com/encryptedname
To download click the output of sourceUrl
.
There's also a Feature Request for downloading source code for app engine, you can star the public issue tracker feature requests to ensure that you will receive the updates about it. But please note that there is no guarantee that this feature will be implemented.

- 3,482
- 1
- 11
- 23
-
1Thanks for the response John. I ran the gcloud app versions and it gave me sourceUrl for each file separately. The project that I am trying to download contains 100s of files. Is there a way to download the entire project's source at once? – Heisenberg W Mar 25 '21 at 07:11
-
If you pertaining to App Engine Version whole files, currently there is no way. You will do it one file at a time or copy paste the content of the file one by one in App Engine > Version > Diagnose(Column) > Tools > Source. The bucket name that I mentioned is temporary storage and contains all files from deployed App Engine version. You can download the whole bucket but it's hard to specify what file it is from its name and what files that you are needed. – JM Gelilio Mar 25 '21 at 08:06
-
Our App - https://nocommandline.com - now supports downloading source code for any deployment (update) not older than 15 days from your current date (unless you previously increased the deletion age on your staging bucket's lifecycle page). For more information, refer to https://nocommandline.com/help/#faq_download_source_code_from_gae. It solves the problem described in the response by @john-michael-gelilio. Later, we will do a writeup about how to change the 15 days lifespan in your staging bucket (FYI @bhito) – NoCommandLine May 01 '21 at 05:43
-
1This access is now forbidden by google. Source file link comes out with the error – Gayan Pathirage Jul 01 '21 at 02:26
I did compile a few options to fetch App Engine's code in this repo, but to sum it up:
If you use App Engine Standard:
- Try to look in Stackdriver Debugger
- The staging bucket contains the files used on deployment time, you can get them from there (although it's not a good idea if there are many files deployed).
In case of App Engine Flex:
- SSH into any of the VMs and then download the files directly from there
- Fetch the image from GCR that was created when deploying so you can download the files from there

- 2,083
- 7
- 13