Skip to content

Instantly share code, notes, and snippets.



Last active Oct 1, 2020
What would you like to do?
Regenerate DockerHubBuildTriggers.json
triggers = {};
(function () {
var s = document.createElement('script');
s.setAttribute('src', '');
// Pause as we need jQuery object to be available, and so we need to let time to the browser to load the script
jQuery.getJSON("", function (response) {
for (result of response["results"]) {
image = result["namespace"] + "%2F" + result["name"];
url: "" + image,
context: {image: image.replace("%2F", "/")}
}).done(function (response) {
object = response["objects"][0]
if (object) {
url: "" + object["uuid"] + "/trigger/",
context: {image: object["image"]}
}).done(function (response) {
triggers[this["image"]] = response["objects"][0]["url"]
} else {
console.warn("No automated build for " + this["image"])
// Pause to let some time to the requests to be processed
// We've got a winner :)

This comment has been minimized.

Copy link
Owner Author

@dereckson dereckson commented Oct 1, 2020

This procedure allows to fetch the trigger build URL for each automated build repo.

  1. Go to any Docker Hub page
  2. Ensure you're logged in
  3. Run each step in the browser console (steps allow async calls to succeed)

The final object is a JSON document we can publish to /srv/notifications/storage/app/DockerHubBuildTriggers.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment