【问题标题】:CI CD Pipeline on GKE - Push Manifest Fail (Finished Step #5 - "Push manifest" ERROR)GKE 上的 CI CD 管道 - 推送清单失败(已完成步骤 #5 -“推送清单”错误)
【发布时间】:2019-11-04 17:06:09
【问题描述】:

我正在为 GKE 上的 Spring 启动应用程序设置 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 中提到的所有准则

【问题讨论】:

    标签: kubernetes google-cloud-platform google-kubernetes-engine continuous-deployment google-cloud-build


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-11
      • 1970-01-01
      • 2022-10-25
      • 1970-01-01
      • 2016-08-24
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多