Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48596

Support for Docker Trusted Registry (DTR) webhooks

    XMLWordPrintable

Details

    Description

      Docker Trusted Registry (DTR), which is part of the Docker EE product suite, uses different JSON payloads than DockerHub and the OSS Registry v2. 

      Documented here: https://docs.docker.com/datacenter/dtr/2.4/guides/user/create-and-manage-webhooks/

      It would be great if this plugin also supported DTR webhooks.

      Attachments

        Activity

          esmalling Eric Smalling added a comment - Beginning work on this in: https://github.com/ericsmalling/dockerhub-notification-plugin  

          Code changed in jenkins
          User: Robert Sandell
          Path:
          Jenkinsfile
          http://jenkins-ci.org/commit/dockerhub-notification-plugin/1f197d01ad081999f178d4110bc07ec67ebd126b
          Log:
          Merge pull request #17 from ericsmalling/get-into-ci

          JENKINS-48596 - Adding Jenkinsfile

          Compare: https://github.com/jenkinsci/dockerhub-notification-plugin/compare/9641b4f4d9d4...1f197d01ad08

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: Jenkinsfile http://jenkins-ci.org/commit/dockerhub-notification-plugin/1f197d01ad081999f178d4110bc07ec67ebd126b Log: Merge pull request #17 from ericsmalling/get-into-ci JENKINS-48596 - Adding Jenkinsfile Compare: https://github.com/jenkinsci/dockerhub-notification-plugin/compare/9641b4f4d9d4...1f197d01ad08
          esmalling Eric Smalling added a comment -

          rsandell,

          Docker Trusted Registry has 5 different events that you can select to trigger this webhook call from a given repository:

          1. Tag pushed to repository
          2. Tag deleted from repository
          3. Manifest pushed to repository
          4. Manifest deleted from repository
          5. Security scan completed (on a tag that was pushed)

          I'd predict that the vast majority of users would be triggering based on #1 with #5 being the second most used.

          I'm thinking, though, that it might make sense to provide a way for a job to be configured to act on specific types of events (they are indicated in the JSON payload with in a type field) but that would require adding a multi-selection type UI element to the job configuration and I've not done that before.   How hard would that be?

          esmalling Eric Smalling added a comment - rsandell , Docker Trusted Registry has 5 different events that you can select to trigger this webhook call from a given repository: Tag pushed to repository Tag deleted from repository Manifest pushed to repository Manifest deleted from repository Security scan completed (on a tag that was pushed) I'd predict that the vast majority of users would be triggering based on #1 with #5 being the second most used. I'm thinking, though, that it might make sense to provide a way for a job to be configured to act on specific types of events (they are indicated in the JSON payload with in a type field) but that would require adding a multi-selection type UI element to the job configuration and I've not done that before.   How hard would that be?

          Code changed in jenkins
          User: rsandell
          Path:
          src/main/java/org/jenkinsci/plugins/registry/notification/DockerHubTrigger.java
          src/main/java/org/jenkinsci/plugins/registry/notification/EnvContributor.java
          src/main/java/org/jenkinsci/plugins/registry/notification/events/EventType.java
          src/main/java/org/jenkinsci/plugins/registry/notification/events/EventTypeDescriptor.java
          src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/ManifestDeleted.java
          src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/ManifestPushed.java
          src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/SecurityScanCompleted.java
          src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/TagDeleted.java
          src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/TagPushed.java
          src/main/resources/org/jenkinsci/plugins/registry/notification/DockerHubTrigger/config.groovy
          src/main/resources/org/jenkinsci/plugins/registry/notification/Messages.properties
          http://jenkins-ci.org/commit/dockerhub-notification-plugin/b124e9076802061ce55207d615c953b9681e0695
          Log:
          JENKINS-48596 Example of selecting events from UI

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/org/jenkinsci/plugins/registry/notification/DockerHubTrigger.java src/main/java/org/jenkinsci/plugins/registry/notification/EnvContributor.java src/main/java/org/jenkinsci/plugins/registry/notification/events/EventType.java src/main/java/org/jenkinsci/plugins/registry/notification/events/EventTypeDescriptor.java src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/ManifestDeleted.java src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/ManifestPushed.java src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/SecurityScanCompleted.java src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/TagDeleted.java src/main/java/org/jenkinsci/plugins/registry/notification/events/impl/TagPushed.java src/main/resources/org/jenkinsci/plugins/registry/notification/DockerHubTrigger/config.groovy src/main/resources/org/jenkinsci/plugins/registry/notification/Messages.properties http://jenkins-ci.org/commit/dockerhub-notification-plugin/b124e9076802061ce55207d615c953b9681e0695 Log: JENKINS-48596 Example of selecting events from UI
          rsandell rsandell added a comment - esmalling Example UI here: https://github.com/jenkinsci/dockerhub-notification-plugin/commit/b124e9076802061ce55207d615c953b9681e0695 You can pull from this branch into yours and refine:  https://github.com/jenkinsci/dockerhub-notification-plugin/tree/ui-events-selector-for-JENKINS-48596
          ccirit Cagdas Cirit added a comment -

          esmalling rsandell any update about the issue?

          ccirit Cagdas Cirit added a comment - esmalling rsandell any update about the issue?

          People

            esmalling Eric Smalling
            esmalling Eric Smalling
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: