I’m trying to use docker hub as part of a CD solution, and it’s frustrating that webhooks are only fired on success. If a build fails, there is no way of knowing. My current thinking is to do some hack with polling the build page and scraping the html, but that’s gross.
Are there any plans for this, or for an API to query build status at least?
@jaredly Like @rufus said we have email notifications right now, and that is all that is currently supported. There are plans to add webhooks, as well as other notifications (IRC, slack, etc) types in the future.
Can you let us know what you would like to see in the payload for the webhook, and any other requirements you might have, and then we can add it to our notes.
We’ve gotten most of the way through migrating to the public Hub for our images when I noticed that the webhooks only were sent for successful builds.
Since we run tests as part of our Dockerfile, the automatic builds in our private repos is fully sufficient as a CI system, when we run a little service to receive the webhook and post to Slack (this also makes the path to CD an easier option, once we’re ready to say that “image builds” equates to “service can be deployed”).
Having to tell developers to “just look at Slack” for the status of the build and their Docker images would be an significantly easier than “look at Slack for success messages, and go check this separate email list for failure messages”.
How do you get to this link via UI, or is it API only?
When I’m logged into the hub and then access that URI, it redirects me to the hub front page. I’ve got an organization setup, we’re having docker builds failing, and no notifications - can’t seem to drive to a UI element that lets me configure relevant notifications.
You can use zapier.com to achieve your goal while you wait for this feature to be implemented.
What you need to do in Zapier is create a new “Zap”, and select either “Email by Zapier” or “Email parser by Zapier” as trigger. If you choose the parser, you can try to extract some data from the email like project name and failed build URL.
It will generate a email adres for you, any incoming mails on that email adres will trigger any action you specify ( for example: send message to slack channel. )
Now in your mail box you need to create a auto forwarder that forwards any emails from “email@example.com” and contains title “There’s been an issue with your automated build” and in the body your project name. You forward these emails to the email you got from Zap, and your action will be triggered. Creating a filter like this is easy in Gmail.
The solution is a bit hacky, but I just tested it and it works perfect.
One of the options is to poll Docker Hub v2 API and emulate the missing webhook notifications whenever the build history reports a failure (-1) or the build remains Queued for too long. The solution is described here: Docker on-failure Webhook. If the build fails intermittently, you can retaliate against Docker Hub by initiating a retry using remote triggers.