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

Add support for the Docker Notification Plugin

    Details

    • Similar Issues:

      Description

      See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

      Configuration section
        <triggers>
          <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
            <spec></spec>
            <options class="vector">
              <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
              <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                <repoNames>
                  <string>testimage</string>
                </repoNames>
              </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
            </options>
          </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
        </triggers>
      

        Attachments

          Issue Links

            Activity

            chbloemer Christoph Blömer created issue -
            chbloemer Christoph Blömer made changes -
            Field Original Value New Value
            Description See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

            Confix.xml Code Snippet:
            {code:xml}
              <triggers>
                <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
                  <spec></spec>
                  <options class="vector">
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                      <repoNames>
                        <string>testimage</string>
                      </repoNames>
                    </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                  </options>
                </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
              </triggers>
            {code}
            chbloemer Christoph Blömer made changes -
            Description See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

            Confix.xml Code Snippet:
            {code:xml}
              <triggers>
                <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
                  <spec></spec>
                  <options class="vector">
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                      <repoNames>
                        <string>testimage</string>
                      </repoNames>
                    </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                  </options>
                </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
              </triggers>
            {code}
            See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

            Config.xml Code Snippet:
            {code:xml}
              <triggers>
                <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
                  <spec></spec>
                  <options class="vector">
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                      <repoNames>
                        <string>testimage</string>
                      </repoNames>
                    </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                  </options>
                </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
              </triggers>
            {code}
            chbloemer Christoph Blömer made changes -
            Description See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

            Config.xml Code Snippet:
            {code:xml}
              <triggers>
                <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
                  <spec></spec>
                  <options class="vector">
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                      <repoNames>
                        <string>testimage</string>
                      </repoNames>
                    </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                  </options>
                </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
              </triggers>
            {code}
            See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

            {code:xmll|title=Configuration section}
              <triggers>
                <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
                  <spec></spec>
                  <options class="vector">
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                      <repoNames>
                        <string>testimage</string>
                      </repoNames>
                    </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                  </options>
                </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
              </triggers>
            {code}
            Labels job-dsl
            chbloemer Christoph Blömer made changes -
            Description See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

            {code:xmll|title=Configuration section}
              <triggers>
                <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
                  <spec></spec>
                  <options class="vector">
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                      <repoNames>
                        <string>testimage</string>
                      </repoNames>
                    </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                  </options>
                </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
              </triggers>
            {code}
            See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification

            {code:xml|title=Configuration section}
              <triggers>
                <org.jenkinsci.plugins.registry.notification.DockerHubTrigger plugin="dockerhub-notification@2.0">
                  <spec></spec>
                  <options class="vector">
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerForAllUsedInJob/>
                    <org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                      <repoNames>
                        <string>testimage</string>
                      </repoNames>
                    </org.jenkinsci.plugins.registry.notification.opt.impl.TriggerOnSpecifiedImageNames>
                  </options>
                </org.jenkinsci.plugins.registry.notification.DockerHubTrigger>
              </triggers>
            {code}
            Hide
            daspilker Daniel Spilker added a comment -

            The upcoming Job DSL release will add generic support for any plugin. See https://github.com/jenkinsci/job-dsl-plugin/pull/816 for details.

            Here is an example for the generic DSL for the Docker Hub trigger:

            job('example') {
              triggers {
                dockerHubTrigger {
                  options {
                    triggerForAllUsedInJob()
                    triggerOnSpecifiedImageNames {
                      repoNames(['foo', 'bar'] as Set)
                    }
                  }
                }
              }
            }
            

            It's possible to add symbolic names to the Docker Hub plugin to get a concise DSL. I already did this for the Gerrit Trigger plugin, see https://github.com/jenkinsci/gerrit-trigger-plugin/pull/280.

            Show
            daspilker Daniel Spilker added a comment - The upcoming Job DSL release will add generic support for any plugin. See https://github.com/jenkinsci/job-dsl-plugin/pull/816 for details. Here is an example for the generic DSL for the Docker Hub trigger: job( 'example' ) { triggers { dockerHubTrigger { options { triggerForAllUsedInJob() triggerOnSpecifiedImageNames { repoNames([ 'foo' , 'bar' ] as Set) } } } } } It's possible to add symbolic names to the Docker Hub plugin to get a concise DSL. I already did this for the Gerrit Trigger plugin, see https://github.com/jenkinsci/gerrit-trigger-plugin/pull/280 .
            daspilker Daniel Spilker made changes -
            Link This issue is related to JENKINS-34105 [ JENKINS-34105 ]
            daspilker Daniel Spilker made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            daspilker Daniel Spilker made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            Assignee Daniel Spilker [ daspilker ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 170074 ] JNJira + In-Review [ 209913 ]

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                chbloemer Christoph Blömer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: