问题描述
我不小心丢失了云函数的最新源文件,然后使用旧版本再次部署了云函数.
I accidentally lost my up to date source file of a cloud function and then deployed again the cloud function with an old version of it.
每次部署云功能时,我都会在控制台上看到部署的版本 ID.
Each time I deploy a cloud function I see on the console the version id of the deploy.
我可以做些什么来回滚到源文件的先前版本吗?
Is there something I can do to roll back to the previous version of the source file?
推荐答案
我终于想通了:
每次部署到云函数时,都会得到如下输出行:
Each time you make a deploy to a cloud function you get an output line like this:
sourceArchiveUrl:gs://my-store-bucket/us-central1-function_name-xxoxtdxvxaxx.zip
sourceArchiveUrl: gs://my-store-bucket/us-central1-function_name-xxoxtdxvxaxx.zip
我进入了我的 Google Cloud Platform Developer Console -> Cloud Functions -> function_name -> Source 选项卡
I entered my Google Cloud Platform Developer Console -> Cloud Functions -> function_name -> Source tab
几乎在底部它说:来源位置
and there almost at the bottom it says:Source location
my-store-bucket/us-central1-function_name-xxoxtdxvxaxx.zip
my-store-bucket/us-central1-function_name-xxoxtdxvxaxx.zip
与 CLI 中显示的相同,但没有 gs://该链接将我引向以下内容:https://storage.cloud.google.com/my-store-bucket/us-central1-function_name-........
the same as it was shown in the CLI, but without gs://that link lead me to the following:https://storage.cloud.google.com/my-store-bucket/us-central1-function_name-........
我从链接中删除了之后的所有内容
I removed from the link everything that came after
https://storage.cloud.google.com/my-store-bucket
这让我看到了一个巨大的文件列表,每个文件都代表了我在每次部署时的所有云功能的图像,这正是我需要的!
and that lead me to a huge list of files that each one of them represented a an image of all my cloud functions at the time point of each time i have made a deploy, exactly what i needed!
唯一要做的就是找到我错误部署前最后日期的文件
The only thing left to do was to locate the file with the last date before my mistaken deploy
这篇关于检索旧版本的 Google Cloud 函数源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!