<p>I am working on setting up CI CD pipeline for Spring boot application on GKE.
While doing the CI using Cloud Build on GCP, Build fail while pushing the updated manifest to candidate branch. "Failed at Step 5"
I could see below logs in the cloud build</p>

<pre><code>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 &lt;%ae&gt; -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 &lt;983160928936@cloudbuild.gserviceaccount.com&gt;
Finished Step #5 - "Push manifest"
ERROR
ERROR: build step 5 "gcr.io/cloud-builders/gcloud" failed: exit status 1
</code></pre>

<p>To set up this pipeline, I followed all the guidelines mentioned at <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/gitops-cloud-build" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/tutorials/gitops-cloud-build</a></p>

nsingla85
<p>This tutorial's code supposes that build triggers when there are actual changes to the source code, and it looks like you are trying to trigger it manually from console.
When there are no changes step 5 of cloudbuild.yaml exits with error status due to empty git commit, which by default exits with error status when there is nothing to commit. </p>

<p>You can use <code>--allow-empty</code> flag with it according to <a href="https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---allow-empty" rel="nofollow noreferrer">man page</a>, but keep in mind that it will create an actual commit even if it is the same as previous one.
If you don't want such commit but just want to suppress the error you can explicitly add <code>|| exit 0</code> at the end of step 5 to ignore errors.</p>
