Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker hub webhook for _failed_ build?

I have several automated builds set up on docker hub. I see that I can set up a webhook to POST to a URL on a successful build, but it seems like it's more useful to be notified of a failed build. Is there any way to do that?

I tried adding a webhook and then pushing a deliberately bad RUN instruction to my Dockerfile. The automated build failed as expected but nothing was sent to my webhook.

Some of my builds are triggered not by git pushes but by cron jobs, so even if I tested the build before every commit, it wouldn't catch this situation. Builds that are successful one day could fail the next due to changing contents of URLs downloaded via ADD.

So...is there a way to get a notification of a failed automated build? If not, consider this a feature request.

like image 649
Dan Tenenbaum Avatar asked Oct 20 '22 21:10

Dan Tenenbaum


1 Answers

You can turn on email-based notifications that a build has failed by going under your user settings option and clicking on notifications and checking the appropriate box. (Thanks @docker twitter account; this wasn't obvious to me either! https://twitter.com/DockerSupport/status/555912171792527360 )

As you have observed, a webhook for a POST event is not available for failed builds. I imagine the idea is that these are more for triggering some follow-up event such as telling a machine to pull the new image, while an email notification makes more sense for a failed build.

like image 89
cboettig Avatar answered Oct 22 '22 23:10

cboettig