gcloud: how to download the app via cli

前端 未结 3 731
情话喂你
情话喂你 2020-12-07 02:12

I depolyed an app with gcloud preview app deploy.

Is there a way to download it to an other local machine? How can I get the files? I tried it via ssh with no succes

3条回答
  •  清歌不尽
    2020-12-07 02:16

    I am coming to Google App Engine after two years, I see that they have made lots of improvements and added tons of features. But sadly, their documentation sometimes leaves much to be desired.

    I used to download my code of the uploaded version with the appcfg.pyusing the following command.

    appcfg.py download_app -A -V

    But of course now that they have culminated everything in the gcloud shell where appcfg.py is not accessible.

    However, the following method helped me to download the deployed code:

    1. Go the console and in to the Google App Engine.
    2. Select the project you want to work with.

    3. Once the project's dashboard opens, Click on the top right to open the built in console window.

    4. Which should load the cloud shell at the bottom, now if you check appcfg.py is available to you to use in this VM.

      enter imagedescription her[2]

    5. Hence, use appcfg.py download_app -A -V to download the code.

    6. Now once you have the code in the desired folder, in order to download it on your local machine - You can open the docker code editor

    7. Now here I assumed if I rightclicked and exported the desired folder it would work,

      but instead it gave me the following error message.

      {"Error":"'concurrency' must be a number but it is [object Undefined]","Message":"'concurrency' must be a number but it is [object Undefined]"}
      
    8. So, I thought maybe it would play along nicely if the the folder was an archive. Go back to the cloud shell and using whatever utility you fancy make an archive of the folder

      zip -r mycode.zip mycode
      
    9. Go to the docker code editor, export and download.

    Now. Of course there might many more ways do it (hopefully) but this is what made sense to me after returning to Google App Engine after 2 years.

提交回复
热议问题