| <!doctype html> |
| <html class="no-js" lang="en" dir="ltr"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>Bringing GitPubSub to the Apache Jenkins build server - Apache Infrastructure Website</title> |
| <link href="/css/bootstrap.min.css" rel="stylesheet"> |
| <link href="/css/fontawesome.all.min.css" rel="stylesheet"> |
| <link href="/css/headerlink.css" rel="stylesheet"> |
| <script src="/highlight/highlight.min.js"></script> </head> |
| <body class="d-flex flex-column h-100"> |
| <main class="flex-shrink-0"> |
| <!-- nav bar --> |
| <nav class="navbar navbar-expand-lg navbar-dark bg-dark" aria-label="Fifth navbar example"> |
| <div class="container-fluid"> |
| <a class="navbar-brand" href="/"><img src="/images/feather.png" style="height: 32px;"/> Apache Infrastructure</a> |
| <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarADP" aria-controls="navbarADP" aria-expanded="false" aria-label="Toggle navigation"> |
| <span class="navbar-toggler-icon"></span> |
| </button> |
| |
| <div class="collapse navbar-collapse" id="navbarADP"> |
| <ul class="navbar-nav me-auto mb-2 mb-lg-0"> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">About</a> |
| <ul class="dropdown-menu"> |
| <li><a class="dropdown-item" href="/team.html">About the team</a></li> |
| <li><a class="dropdown-item" href="/roundtable.html">The Infrastructure Roundtable</a></li> |
| <li><a class="dropdown-item" href="/blog/">The Infrastructure Blog</a></li> |
| </ul> |
| </li> |
| <li class="nav-item"> |
| <a class="nav-link" href="/policies.html">Policies</a> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Services and Tools</a> |
| <ul class="dropdown-menu"> |
| <li><a class="dropdown-item" href="/services.html">Services and Tools</a></li> |
| <li><a class="dropdown-item" href="/machines.html">Machines and Fingerprints</a></li> |
| <li><a class="dropdown-item" href="https://blocky.apache.org/">Blocky</a></li> |
| <li><a class="dropdown-item" href="https://app.datadoghq.com/account/login?next=%2Finfrastructure">DataDog</a></li> |
| <li><a class="dropdown-item" href="https://whimsy.apache.org/roster/committer/" target="_blank">Committer Search</a></li> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Documentation</a> |
| <ul class="dropdown-menu"> |
| <li><a class="dropdown-item" href="/doc.html">Contribute</a></li> |
| <li><a class="dropdown-item" href="/infra-volunteer.html">Volunteer with Infra</a></li> |
| <li><a class="dropdown-item" href="/how-to-mirror.html">Become an ASF download mirror</a></li> |
| <li><a class="dropdown-item" href="/hosting-external-agent.html">Host a Jenkins or Buildbot agent</a></li> |
| |
| </ul> |
| </li> |
| <li class="nav-item"> |
| <a class="nav-link" href="/stats.html">Status</a> |
| </li> |
| <li class="nav-item"> |
| <a class="nav-link" href="/contact.html">Contact Us</a> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </nav><!-- breadcrumbs --> |
| <div class="card" style="height: 34px;"> |
| <nav aria-label="breadcrumb" style="padding-left: 12px; padding-top: 4px;"> |
| <ol class="breadcrumb"> |
| <li class="breadcrumb-item"><a href="/">Home</a></li> |
| |
| <li class="breadcrumb-item active"><a href="/blog/bringing-gitpubsub-to-the-apache.html"> |
| Bringing GitPubSub to the Apache Jenkins build server </a></li> |
| |
| <li class="breadcrumb-item active">(<a href="https://github.com/apache/infrastructure-website/tree/master/content/blog/bringing-gitpubsub-to-the-apache.md">edit</a>)</li> |
| |
| </ol> |
| </nav> |
| </div> |
| |
| |
| <!-- page contents --> |
| <div id="contents"> |
| <div class="bg-white p-5 rounded"> |
| <div class="col-sm-8 mx-auto"> |
| <h1> |
| Bringing GitPubSub to the Apache Jenkins build server |
| </h1> |
| <p>Posted on: 2017-03-26 01:07:08+00:00</p> |
| <p> |
| When it comes to <a href="#Jenkins">[Jenkins</a>], it has long been known that [polling must die]. |
| </p> |
| <p>While we could go and create post commit hooks in all the ASF hosted Git repositories, that is something that realistically is just creating an added maintenance burden. |
| <p>In any case, we have [GitPubSub]. </p></p> |
| <p>The question then becomes, how do we integrate [GitPubSub] with [Jenkins]? |
| <p>Thankfully, ASF committer stephenc is also an active committer to the [Jenkins] project and created a [plugin] that connects to [GitPubSub] parses the events and passes them through to the Jenkins [SCM API].</p> |
| </p> |
| <p> |
| What does this mean? |
| </p> |
| <p>* You can turn your Git polling down - way way down - to something like once per day. |
| This should significantly reduce the load on both the ASF git servers and builds.apache.org<br/>* Your builds will be triggered in seconds rather than having to wait for the next polling run.<br/>* You can try out using Multi-branch projects much like the [Maven] project has been doing for [Maven core] and [Maven Surefire] |
| </p> |
| <p> |
| If the reaction to this change proves positive, the next step will be to integrate SvnPubSub with Jenkins and bring the benefits to the Subversion based projects too |
| </p> |
| <p> </p> |
| <p>See also this blog post by Stephen Connolly:</p> |
| <p> <a href="https://www.cloudbees.com/blog/using-multi-branch-pipelines-apache-maven-project">https://www.cloudbees.com/blog/using-multi-branch-pipelines-apache-maven-project</a><br/></p> |
| <p>[polling must die]: http://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/<br/>[GitPubSub]: https://www.apache.org/dev/gitpubsub.html |
| <br/> <a name="Jenkins">[Jenkins]</a>: https://jenkins.io/ |
| <br/>[plugin]: https://github.com/stephenc/asf-gitpubsub-jenkins-plugin |
| <br/>[SCM API]: https://plugins.jenkins.io/scm-api |
| <br/>[Maven]: https://maven.apache.org |
| <br/>[Maven core]: https://builds.apache.org/job/maven-3.x-jenkinsfile/ |
| <br/> [Maven Surefire]: https://builds.apache.org/job/maven-surefire-pipeline/ |
| </p> |
| <p>Posted on behalf of Committer Stephen Connolly (stephenc) |
| </p> |
| |
| </div> |
| </div> |
| </div> |
| <!-- footer --> |
| <div class="row"> |
| <div class="large-12 medium-12 columns"> |
| <p style="font-style: italic; font-size: 0.8rem; text-align: center;"> |
| Copyright 2024, <a href="https://www.apache.org/">The Apache Software Foundation</a>, Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br/> |
| Apache® and the Apache feather logo are trademarks of The Apache Software Foundation... |
| </p> |
| </div> |
| </div> |
| <script type="application/ecmascript" src="/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"></script> </main> |
| </body> |
| </html> |