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

          Christoph Blömer created issue -
          Christoph Blömer made changes -
          Description Original: See https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Hub+Notification New: 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}
          Christoph Blömer made changes -
          Description Original: 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}
          New: 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}
          Christoph Blömer made changes -
          Description Original: 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}
          New: 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 New: job-dsl
          Christoph Blömer made changes -
          Description Original: 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}
          New: 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}

          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 .
          Daniel Spilker made changes -
          Link New: This issue is related to JENKINS-34105 [ JENKINS-34105 ]
          Daniel Spilker made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Daniel Spilker made changes -
          Assignee New: Daniel Spilker [ daspilker ]
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 170074 ] New: JNJira + In-Review [ 209913 ]

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

              Created:
              Updated:
              Resolved: