[英]Python cloud function is not updated after rebuild
Steps to reproduce:重现步骤:
Expected Results: A new function is built and redeployed.预期结果:构建并重新部署一个新的 function。
Actual Results: Cloud Build is triggered and a new ACTIVE version is observed, however the old content is still returned.实际结果:触发 Cloud Build 并观察到新的 ACTIVE 版本,但仍返回旧内容。 Downloaded source code from console is old.从控制台下载的源代码是旧的。 However, manual redeployment without changes works (just by getting to edit tab and clicking deploy).但是,无需更改即可手动重新部署(只需进入编辑选项卡并单击部署)。
Note: This question is similar to this .注意:这个问题和这个类似。 However, here we are using Python 3.7 and and not a Node.js code, and accourding to GC release notes Python 3.7 is fully released and is not in beta.然而,这里我们使用的是 Python 3.7 而不是 Node.js 代码,并且根据GC 发行说明Python 3.7 已完全发布且未处于测试阶段。
So is it a bug or I'm missing something?那么这是一个错误还是我遗漏了什么?
The solution is found, just relace existing cloudbuild.yaml on following code:找到解决方案,只需将现有的 cloudbuild.yaml 替换为以下代码:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['functions', 'deploy', 'la-repo-function-1', '--source','.','--trigger-http', '--runtime', 'python37', '--entry-point', 'greetings_http']
In other words source param is mandatory(however it's presence is not automatically validated)换句话说 source 参数是强制性的(但它的存在不会自动验证)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.