GKE上的CI CD管道-推送清单失败(步骤5完成-“推送清单”错误)

我正在为GKE上的Spring Boot应用程序设置CI CD管道。 在GCP上使用Cloud Build执行CI时,将更新的清单推送到候选分支时构建失败。 “在步骤5失败” 我可以在云构建中看到以下日志

Finished Step #4 - "Generate manifest"
Starting Step #5 - "Push manifest"
Step #5 - "Push manifest": Already have image (with digest): gcr.io/cloud-builders/gcloud
Step #5 - "Push manifest": + cd eureka-cloudbuild-env
Step #5 - "Push manifest": + git add kubernetes.yaml
Step #5 - "Push manifest": + git log --format=%an <%ae> -n 1 HEAD
Step #5 - "Push manifest": On branch candidate
Step #5 - "Push manifest": Your branch is up to date with 'origin/candidate'.
Step #5 - "Push manifest": 
Step #5 - "Push manifest": nothing to commit,working tree clean
Step #5 - "Push manifest": + git commit -m Deploying image gcr.io/amcartecom/eureka-cloudbuild:v2
Step #5 - "Push manifest": Built from commit 34dfdd69af726f80d3b91b29127e0c77cc2a83cf of repository eureka-cloudbuild-app
Step #5 - "Push manifest": Author: root <983160928936@cloudbuild.gserviceaccount.com>
Finished Step #5 - "Push manifest"
ERROR
ERROR: build step 5 "gcr.io/cloud-builders/gcloud" failed: exit status 1

要设置此管道,我遵循了https://cloud.google.com/kubernetes-engine/docs/tutorials/gitops-cloud-build

中提到的所有准则
X00400 回答:GKE上的CI CD管道-推送清单失败(步骤5完成-“推送清单”错误)

本教程的代码假定在对源代码进行实际更改时生成触发器,并且看起来您正试图从控制台手动触发它。 当没有更改时,由于git commit为空,cloudbuild.yaml的第5步以错误状态退出,默认情况下,没有任何提交时,它以错误状态退出。

您可以根据man page--allow-empty标志与其一起使用,但是请记住,即使它与先前的标志相同,它也会创建一个实际的提交。 如果您不希望这样的提交,而只是想抑制错误,则可以在步骤5的末尾显式添加|| exit 0来忽略错误。

本文链接:https://www.f2er.com/3164979.html

大家都在问