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

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

问题描述

因此,从一些SO问题看来,我发现这在其他用户中是一个问题.最近,我们的一位首席开发人员离开了,我继承了他的许多项目.其中之一是一个貌似的网站,该网站位于来自Google云平台的应用程序引擎上.从 App Engine文档下载使用appcfg.py download_app命令的源代码.我做到了,但是从该调用中得到的唯一结果是:

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.

抓着头看着各种SO帖子,有人提到了一些有关直接进入google cloud vm并执行相同命令的事情,令我惊讶的是发现了与我在本地终端中所做的相同的确切行为.

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.

这使我意识到它一定在起作用.我查看了GCP上App Engine仪表板中的versions标签.我看到我的实例正在运行,它正确显示Serving,如果我单击链接,它将带我到可以正常加载的网站.但是,在Size下显示的是0 B,这使我认为也许这就是为什么download_app不下载任何内容的原因,因为版本是0 B?

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?

我要弄清楚的是为什么它的版本号为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

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

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.

编辑

为了让每个人都知道,我还确保我的用户具有正确的权限. OwnerApp Engine Owner ...等.我不认为这是问题.

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.

推荐答案

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

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.

或者,您可以转到开发人员控制台>容器注册表>构建历史记录,然后为您的版本选择构建,从而找到源代码的确切Cloud Storage URL.您将在构建信息"下找到指向您的源代码的链接.

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.

但是要注意的一件事是,默认情况下会使用生命周期规则创建staging ...存储桶,该规则会自动删除15天以上的文件.如果需要,可以删除此规则,以便无限期保留所有版本的源代码.

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.

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

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天全站免登陆