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

Add support for the Docker Notification Plugin

      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>
      

          [JENKINS-34054] Add support for the Docker Notification Plugin

          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.

          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
            chbloemer Christoph Blömer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: