我的自动化云功能部署有问题
我有一个存储在 Google Cloud 存储库中的云函数
Git 代码包含一个包含以下内容的 cloudbuild.yaml 文件:
steps:
- name: "gcr.io/cloud-builders/gcloud"
args: ["functions", "deploy", "myfunction", "--region=europe-west1"]
timeout: "1600s"
Run Code Online (Sandbox Code Playgroud)
我只有一个分部Master。
当我推送提交时,cloudbuild 会触发并部署云功能
问题是它总是部署前一个提交,而不是最后一个
例如:2:23:我将源代码推送到 Google 源存储库
结果如下:
2:23:33,cloudbuild触发并成功部署云函数
这是 Cloudbuild 的日志:
starting build "e3a0e735-50fc-4315-bafd-03128156d69f"
FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
From https://source.developers.google.com/p/myproject/r/myrepo
* branch 1b67729b8498c35fc19a45b14b8d674635300594 -> FETCH_HEAD
HEAD is now at 1b67729 PrayingforCommit
BUILD
Already have image (with digest): gcr.io/cloud-builders/gcloud
Deploying function (may take a while - up to 2 minutes)...
...............................................done.
availableMemoryMb: 256
entryPoint: process_gcs
eventTrigger:
eventType: …Run Code Online (Sandbox Code Playgroud)