Is it possible to retry a failed cloud build job automatically?
Solved! Go to Solution.
I believe you can do the following:
You could "Automating builds using build triggers" [1] and trigger a build upon failure by creating a commit on another branch or with a tag.
You could "Create Custom Build Steps" [2] that could read a failure and retry the build [3]
Perhaps the simplest option is to create "Build Notifications" [4] to alert you upon failures to do a manual build retry.
And finally, I found this article [5] which you can use Cloud Build > Pub/Sub > Cloud Functions in an event of failure.
[1] https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
[2] https://cloud.google.com/cloud-build/docs/create-custom-build-steps
[3] https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds/retry
[4] https://cloud.google.com/cloud-build/docs/send-build-notifications
[5] https://www.toptal.com/devops/better-google-cloud-continuous-deployment
I believe you can do the following:
You could "Automating builds using build triggers" [1] and trigger a build upon failure by creating a commit on another branch or with a tag.
You could "Create Custom Build Steps" [2] that could read a failure and retry the build [3]
Perhaps the simplest option is to create "Build Notifications" [4] to alert you upon failures to do a manual build retry.
And finally, I found this article [5] which you can use Cloud Build > Pub/Sub > Cloud Functions in an event of failure.
[1] https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
[2] https://cloud.google.com/cloud-build/docs/create-custom-build-steps
[3] https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds/retry
[4] https://cloud.google.com/cloud-build/docs/send-build-notifications
[5] https://www.toptal.com/devops/better-google-cloud-continuous-deployment