下载 App Engine 源代码 [英] Downloading App Engine source code

查看:31
本文介绍了下载 App Engine 源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,从我看到的一些 SO 问题来看,这是其他用户之间的问题.最近我们的一位首席开发人员离开了,我继承了他的很多项目.其中之一是一个看起来存在于谷歌云平台应用引擎上的网站.从

以及我的终端(本地)的屏幕截图.显然我省略了 -A 和 -V 标志,但它们设置正确,如果我故意使它们不正确,我确实会收到错误消息.

编辑

为了让每个人都知道,我还确保我的用户拥有正确的权限.OwnerApp Engine Owner... 以及其他一些.我不认为这是问题所在.

解决方案

当您部署 App Engine 柔性应用程序时,源代码会上传到您项目上名为 staging 的存储分区中的 Cloud Storage.<project-id>.appspot.com.您可以在此存储分区中导航并以 .tar 文件的形式下载特定版本的源代码.

或者,您可以通过转到 Dev Console > Container Registry > Build History 并选择您的版本的构建来找到源代码的确切 Cloud Storage URL.您可以在 Build Information 下找到指向源代码的链接.

但是需要注意的一点是,staging... 存储桶默认使用生命周期规则创建,该规则会自动删除超过 15 天的文件.您可以根据需要删除此规则,以便无限期保留所有版本的源代码.

在您的情况下,我认为这可能没有帮助,因为文件可能已经被删除,但值得知道您可以从那里获取源代码(默认情况下源代码不会推送到源存储库,您的开发人员必须配置手动).

So it seems from a few SO questions I've seen that this is a problem among other users. Recently one of our head dev's left and I inherited a lot of his projects. One of which, is a website that what seems like lives on an app engine from google cloud platforms. From the App Engine documentation, to download source code you use the appcfg.py download_app command. Which I did, however the only results I get back from that call is:

Fetching file list...
Fetching files...

And then it just ends. No error message or any kind of message at all, and of course, it did not download the source code into the output dir I specified.

Scratching my head and looking at various SO posts, someone mentioned something about going into the google cloud vm directly and doing the same command, and to my surprise finding the same exact behavior that I did in my local terminal.

This made me realize it must be something else at play. I took a look at my versions tab in the App Engine dashboard on GCP. I see my instance running, it correctly says Serving and if I click the link it brings me to the website which loads fine. However, under Size it says 0 B which made me think perhaps this is why the download_app isn't downloading anything, because the version is 0 B?

What I'm trying to figure out is why it says 0 B for the version, when clearly the site runs fine and how I can get the source code for this. Here's a screenshot for reference

And screenshot of my terminal (local). Obviously I omitted the -A and -V flags, but they are correctly set and if I purposely make them incorrect I do indeed get an error message.

EDIT

Just so everyone is aware, I also made sure my user had the correct permissions. Owner, App Engine Owner... and some others. I don't think that's the problem.

解决方案

When you deploy an App Engine Flexible application, the source code is uploaded to Cloud Storage on your project in a bucket named staging.<project-id>.appspot.com. You can navigate in this bucket and download the source code for a specific version as a .tar file.

Alternatively, you can find the exact Cloud Storage URL for your source code by going to Dev Console > Container Registry > Build History and select the build for your version. You'll find the link to your source code under Build Information.

One thing to note however is that the staging... bucket is created by default with a Lifecycle rule that deletes files older than 15 days automatically. You can delete this rule if you want so that all versions' source code is kept indefinitely.

In your case I believe that may not have helped since files may have been deleted already but it's worth knowing you can get the source code from there (source code isn't pushed to Source Repository by default, your developer had to configure it manually).

这篇关于下载 App Engine 源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆