Tag: cloudbees

  • Whitepaper – Easily Build Continuous Delivery Pipelines with Jenkins and Pipeline Plugin

    Whitepaper – Easily Build Continuous Delivery Pipelines with Jenkins and Pipeline Plugin

    Easily-Build-Continuous-Delivery-Pipelines-with-Jenkins-and-Pipeline-Plugin

    Organizations have been orchestrating pipelines with Jenkins for years. As Jenkins and continuous delivery experience deepens, organizations want to move beyond simple pipelines and chart complex flows that map to their specific software delivery processes. For Jenkins users, creating and managing complex pipelines just became easier with Jenkins and the Jenkins Pipeline plugin. Learn what it is, what it does for you, and how to set up your delivery pipelines using it.

    Download this whitepaper and learn how you can deliver software at the speed of ideas.

    [su_button url=”https://www.cloudbees.com/resource/whitepaper/easily-build-continuous-delivery-pipelines-jenkins-and-pipeline-plugin” target=”blank” background=”#ef2d3f”]Download Now[/su_button]

  • Whitepaper – DevOps Performance: The Importance of Measuring Throughput and Stability

    Whitepaper – DevOps Performance: The Importance of Measuring Throughput and Stability

    DevOps-Performance-The-Importance-of-Measuring-Throughput-and-Stability

    Measuring DevOps performance in any business can be a difficult task. Product and engineering teams often lack insight into their software development value streams to determine how work is flowing, where the blockages appear and how to improve their continuous delivery process. These hurdles can be addressed by knowing what key metrics will guarantee success to ensure optimal performance.

    This whitepaper presents a deep dive into:

    • Why measuring DevOps performance is key to an organization’s successful delivery of software.
    • The analysis of DevOps performance metrics for delivering value stream management insights.
    • How CloudBees DevOptics can provide you with a tool for understanding your DevOps software delivery process in a clear and easy-to-understand manner.

    [su_button url=”https://www.cloudbees.com/resource/whitepaper/devops-performance-importance-measuring-throughput-and-stability” target=”blank” background=”#ef2d3f”]Download Now[/su_button]

  • eBook – Building Cloud Native Apps Painlessly – The Prescriptive Guide to Kubernetes and Jenkins X

    eBook – Building Cloud Native Apps Painlessly – The Prescriptive Guide to Kubernetes and Jenkins X

    This new book explains how our industry has reached the cloud native era, which impacts how software applications are developed, tested, deployed and managed. Inside, you’ll read about how the future of modern application development can benefit from the powerful combination of Jenkins X and Kubernetes, providing developers a seamless way to automate their continuous integration (CI) and continuous delivery (CD) process.

    Written by well-known DevOps leaders including Robert Davies, Brian Dawson, James Rawlings and James Strachan, this definitive guide will help you understand:

    • The technical and business benefits of Jenkins X.
    • How developers can use Jenkins X to build cloud native apps.
    • The steps for getting started with Jenkins X.

    [su_button url=”https://www.cloudbees.com/resource/ebook/building-cloud-native-apps-painlessly” target=”blank” background=”#ef2d3f”]Download Now[/su_button]

  • eBook – CI/CD for Cloud Native Applications on Kubernetes

    eBook – CI/CD for Cloud Native Applications on Kubernetes

    CI-CD-for-Cloud-Native-Applications

    Teams often spend days manually setting up Jenkins, pipelines and implementing continuous integration/continuous delivery (CI/CD) effectively. Jenkins X comes with all the automation you need to be able to focus on your application code and tests.

    In this whitepaper, explore the business value Jenkins X brings to organizations who undertake the journey of continuous everything.

    • Automatic software releases with semantic versions, the creation of artifacts, Docker images and Helm charts
    • Automatic promotion of versioned artifacts across your environments via GitOps
    • Preview environments created on each pull request

    [su_button url=”https://www.cloudbees.com/resource/whitepaper/cicd-cloud-native-applications-kubernetes” target=”blank” background=”#ef2d3f”]Download Now[/su_button]

  • CloudBees’ Acquisition of Rollout: The CEOs’ View

    CloudBees’ Acquisition of Rollout: The CEOs’ View

    As Mike Vizard reported yesterday, CloudBees, as part of its mission to build “the world’s first end-to-end automated software delivery system,” announced another acquisition: Rollout, a developer of a feature flag application that allows for simplified testing of new modules within an application.

    Not to repeat the gist of Vizard’s article; you can read it for yourself. But this continues what has become something of an acquisition tear by CloudBees. The company has acquired CodeShip and Electric Cloud, among others, while becoming one of the founding members of the new Continuous Delivery Foundation (CDF), under the Linux Foundation and a sister foundation to the Cloud Native Computing Foundation (CNCF) and the Cloud Foundry Foundation. The CDF is now managing the Jenkins project, as well as Jenkins X, Spinnaker and Tekton.

    CloudBees’ Mission

    Make no mistake: These acquisitions, along with the CDF formation, represent a major change for CloudBees. The team there is clearly trying to separate from the pack of “end-to-end” DevOps contenders. CloudBees CEO Sacha Labourey is pushing hard to raise CloudBees above the noise and the rest of the market. The company announced a $62 million round of financing about a year ago.

    You don’t have to be Warren Buffet to see that CloudBees sees an opportunity here. The company is driving toward achieving scale in product and revenue on the path to some sort of liquidity event (perhaps an IPO?) or market leading opportunity.

    For now, though, back to the Rollout acquisition. I had the chance to sit down with Labourey and the CEO and founder of Rollout, Erez Rusovsky. We discussed what Rollout does, its history and how it will fit into the CloudBees product portfolio.

    It is always great to interview a founder about his company being acquired. What a tremendous feeling of accomplishment to found and build a company, and have another entity value it so much that you are willing to sell it to them. This goes so far beyond validation.

    Congrats to Erez and the whole Rollout team and, of course, congratulations to Sacha, KK and the rest of the CloudBees team. This seems like a perfect fit.

    In the meantime, here is my conversation with Sacha and Erez on the acquisition and more. Enjoy!

     

    — Alan Shimel

  • DevOps World | Jenkins World 2019: Made for Developers

    DevOps World | Jenkins World 2019: Made for Developers

    As a software developer, you might have attended some conferences in the past where the tough topics get breezed over, and there’s not enough technical information to answer your really detailed questions. Well, DevOps World | JenkinsWorld is not that kind of event! Our sessions get into the tough technical questions and get very specific, digging into what works and what doesn’t, how to configure systems for maximum success and how to pull together the best cutting-edge technologies into your DevOps pipeline. Below is just a sample of these interesting and engaging sessions from CloudBees’ staff, partners and customers. If you consider yourself a highly-technical member of the DevOps universe, these are the kind of sessions you’ll want to add to your agenda! If you aren’t registered yet, get started here.

    Who broke the build? — Using Docker to improve local testing and release faster No one wants to be responsible for breaking the build, so how can developers avoid being that person?

    This session will include a brief history of build testing challenges and what difference Docker can make for better, more streamlined builds.

    Ram Mohan Rao Chukka – Appfire – Principal Software Engineer
    Can Jenkins be the engine of Mobile DevOps? There is no doubt that Jenkins has become the engine of DevOps for web apps, but what about for mobile? The mobile DevOps process can be a headache; learn how Jenkins can help. Shashikant Jagtap – XCTEQ Limited – Director
    Smart and stable automated testing using AI based Dynamic Locators One of the biggest problems with UI-based test automation is maintenance. Many tools, frameworks, and approaches already exist to try to solve this issue, but they have had limited success. AI may be the answer to this problem. In this session, learn how AI and AI-based dynamic location strategies can help with UI-based test automation, Raj Subramanian – Testim – Developer Evangelist
    How Jenkins builds and delivers Jenkins in the cloud Want to know how Jenkins builds Jenkins? Catch this session to see the real-life implementation of Jenkins’ development and delivery infrastructure in the cloud as it has evolved from a mix of platforms to multi-platform VMs, containers, and Kubernetes on Microsoft Azure. Brian Benz – Microsoft – Cloud Advocate
    Faster Git This session will review and prioritize techniques to manage large git repositories, including reference repositories, narrow refspecs, and more. Mark Waite – CloudBees – Technical Evangelist
  • CloudBees Acquires Rollout, Adding Feature Flag System to Manage Deployment Risk and Accelerate Software Feature Delivery

    DevOps Leader Adds Feature Flagging Capability, to Help Development Teams Release Software With More Flexibility, Less Risk

    SAN JOSE, Calif. – June 11, 2019 – CloudBees, Inc., the enterprise DevOps leader powering the continuous economy, today announced the acquisition of Rollout, a secure feature management company providing software specifically targeted for developers and product teams. The deal further strengthens CloudBees’ leadership in the continuous integration/continuous delivery (CI/CD) market, giving customers the ability to deliver new features safely, securely and quickly into production.

    The benefit of continuous software delivery is clear for high-performing software developers and teams who want to separate code deployments from feature releases. Customer relationships are enhanced by safely testing features in production environments, gathering valuable feedback and releasing new and improved features continuously. An increased number of incremental feature releases enables fast and early learning. This helps speed up feature adoption and ultimately helps organizations avoid the “big-bang-or-bust” infrequent feature release syndrome. This type of continuous release feature drip is the hallmark of successful continuous software delivery.

    According to Forrester, “Getting ideas in front of users faster — ‘continuous discovery’ — is the new normal. Experimentation platforms let teams test out minimum viable products (MVPs) in real-world scenarios with precise control. Feature flags let AD&D teams develop code as they normally would, allowing them to version control, test and deploy the same as always. However, feature flags give those teams complete control of when to expose a particular feature to users, allowing administrators to turn it on and off at the flip of a switch.”1

    By bringing the Rollout team and their feature flag software into the CloudBees family, CloudBees is taking a big step in the direction of enabling developers and teams to ship changes with freedom. The Rollout solution allows developers to continuously deliver changes, by enabling them to control both the roll out and roll back of features instantly on any platform, including mobile, regardless of deployment restrictions.

    “Our goal is to help organizations deliver great, feature-rich software efficiently while minimizing risks associated with the deployment process,” said Sacha Labourey, CEO and co-founder of CloudBees. “The acquisition of Rollout gives CloudBees customers the flexibility to decouple features from software versions. Using Rollout on their trusted enterprise platform allows developers to test and merge changes with more confidence than ever before.”

    “We’re thrilled to be part of the CloudBees team,” said Erez Rusovsky, CEO and co-founder of Rollout, who will take on the role of product director for the Rollout offering. “CloudBees has set the standard for excellence in CI and CD. Rollout joining forces with CloudBees is genuinely the case where 1+1=3. Feature flags and CI/CD combined help companies truly become continuous and increase the pace of innovation.”

    1Forrester Research, AD&D Pros: Stop Guessing And Start Experimenting, Christopher Condo and Bill Seguin, January 15, 2019

    Additional Resources

    About CloudBees
    CloudBees is powering the continuous economy by offering the world’s first end-to-end continuous software delivery management system (SDM). For millions of developers and product teams driving innovation for businesses large or small, SDM builds on continuous integration (CI) and continuous delivery (CD) to enable all functions and teams within and around the software delivery organization to best work together to amplify value creation.

    CloudBees is the CI, CD and application release orchestration (ARO) powerhouse, built on the commercial success of its products as well as its open source leadership. CloudBees is the largest contributor to Jenkins and Jenkins X, as well as a founding member of the Continuous Delivery Foundation (CDF). From startups with full-stack developers practicing NoOps to large Fortune 100 companies, CloudBees enables all software-driven organizations to intelligently deploy the right capabilities at the right time.

    Over 3,500 of the world’s best known brands and over 50% of the Fortune 500, invest in CloudBees because of its ability to work across any cloud, in any development environment and to balance corporate governance and control with developer flexibility and freedom. CloudBees is home to the world’s leading DevOps experts, helping thousands of companies harness the power of “continuous everything” and putting them on the fastest path from great idea, to great software, to great business value.

    Backed by Matrix Partners, Lightspeed Venture Partners, Verizon Ventures, Delta-v Capital, Golub Capital, Unusual Ventures and HSBC, CloudBees was founded in 2010 by former JBoss CTO Sacha Labourey and an elite team of continuous integration, continuous delivery and DevOps professionals. Follow CloudBees on Twitter, Facebook and LinkedIn.

  • CloudBees Acquires Rollout for Feature Flagging

    CloudBees Acquires Rollout for Feature Flagging

    CloudBees today announced it would extend the reach of the Jenkins continuous integration/continuous development (CI/CD) platform by acquiring Rollout, a provider of feature flag tool that gets employed to simplify testing of new modules within an application.

    Company CEO Sacha Labourey said the acquisition of Rollout would result in a feature flag capability that is more seamlessly integrated with the gates that make up a CI/CD pipeline process. The goal is to make it easier for DevOps teams to apply A/B testing of new application features against a subset of users before deciding to update an entire application environment, he said.

    Feature flagging, also known as feature toggling, enables DevOps teams to hide features from certain users at runtime. In effect, this creates multiple branches from the same source code that DevOps teams need to manage. Rather than having to employ a separate tool based on an entirely different user interface, CloudBees is moving to make feature flagging a core capability of its extended toolchain.

    In theory, feature flagging should be more widely employed than it is today. Many organizations, however, have found it challenging to incorporate separate feature flagging tools within their DevOps processes. CloudBees is now using some of the money it has raised of late to address that issue.

    Feature flagging today is largely confined to testing. However, there may come a day when more organizations will employ feature flagging to make different classes of user experience available to different end users. That approach, in theory, would make it possible to charge different fees for disparate application experiences using the same core application.

    In the meantime, the goal is to garner more feedback concerning new capabilities that might be added to an application before the features are made generally available. Developers often spend months developing new features only to discover end users are not employing those capabilities because of some trivial glitch that could have been discovered easily using A/B testing.

    There currently is no shortage of options when it comes to tools for implementing feature flagging. Labourey said CloudBees elected to acquire Rollout because the team behind it was deemed to have the best cultural fit with CloudBees. It’s too early to say whether other providers of feature flagging tools will be rolled up into other CI/CD platforms—providers of those platforms can either develop their own feature flagging toolsets or move to absorb a third-party provider either by acquiring them or forming a technology alliance. The depth of the toolchain being provided these days often has as much to do with what CI/CD platform ultimately gets adopted as the core integration and delivery capabilities.

    Regardless of the path chosen, it’s apparent that thanks to feature flagging, continuous testing processes will become more sophisticated. That may require some adjustments to existing best DevOps practices, but the days when development teams blindly experiment on end users in the hopes they are building the next killer feature mercifully are coming to an end.

    — Mike Vizard

  • 8 CI/CD Best Practices for Your DevOps Journey

    8 CI/CD Best Practices for Your DevOps Journey

    According to a recent IDC study, the worldwide DevOps software market reached $2.9 billion in 2017 and is forecasted to reach $6.6 billion in 2022. With over 50% of organizations embracing DevOps last year, continuous integration (CI) and continuous delivery (CD) have become an integral part of the software development process.

    Your business is likely embarking on a DevOps transformation of its own. In this blog post, we will discuss CI/CD best practices that can help accelerate adoption no matter where you are in your DevOps journey.

    But first, let’s take a step back and set the stage for why we practice DevOps in the first place.

    Shifting left with CI/CD and the promise of continuous everything

    Continuous integration and continuous delivery refers to the process of developing and delivering software in short cycles of build-configure-deploy-test-release underpinned by automation. In short, we do CI/CD to deliver higher-quality software frequently and predictably.

    CI has become practically ubiquitous to software development. Therefore it is not surprise that as the bread and butter of development, CI is a key practice in DevOps organizations.

    CD is not as widely adopted as CI, but is key to shifting left. CD starts with development, building, unit testing, static code analysis (SCA) and static analysis security testing (SAST) on CI. Eventually, the pipeline extends the automation to functional, integration, performance and security testing, along with configuration management and deployment. These are critical areas for automation — and in a DevOps context they are essential.

    I would even make the jump and say that if you aren’t doing CD, you aren’t doing DevOps well. Why? Because traditional IT operations don’t get involved until AFTER deployment into production – when real users begin hitting the application. How can you expect IT operations to shift left and embrace a culture of DevOps if there is a giant, unautomated chasm in your software delivery pipeline? Asking them to shift left in this context is paramount to asking them to jump of a cliff. If you are doing CI alone, you are likely sole inhabitants of ‘Developer Island’. It might be sunny there, but you are decidedly alone and separate from the rest of the business.

    I know what you’re thinking. This all makes great sense, so why isn’t the CD pipeline automation the norm? The answer is simple… this stuff can be hard and transformation doesn’t happen overnight. It usually begins on the left with CI and as the DevOps initiative matures, CD is the next logical step. It’s certainly not serial out of necessity, but this is the adoption pattern we often see.

    In fact, I have news. Not only does your DevOps transformation not happen overnight, it’s never over. This is all about continuous improvement, which means nothing sits still. There isn’t a DevOps train that terminates at the end of the line. The minute you’ve mastered these best practices, new ones will emerge because every day we as a community get better at delivering software.

    Which brings me to the topic of shift left and continuous everything! When you have both CI and CD pipeline automation in place, you are in a fantastic position from a tools perspective to shift left. This is a perspective shift from problem detection to prevention which means testing earlier, and earlier – effectively shortening test cycle times while preserving code quality. The result? Better software, delivered more quickly that shortens the feedback loop between end users and developers.

    But shifting left isn’t just about tools. It’s also about people and practices – the proverbial DevOps trinity. It means everybody has a stake in the reliable, repeatable delivery of high value software. It means that the documentation team joins the engineering team when stories are being picked for a release. It means that product marketing comes to that same meeting with research on the market opportunity for such a feature. It means that product managers sit on analyst inquiry calls with the analyst relations team. It means that passionate customers beta test features and give meaningful feedback that can be immediately acted upon. It means that before a feature is even released, sales is trained, primed and ready to do pipeline generation. It means DevOps is at the very heart of the business and every function from marketing, to sales to support and services is totally informed and invested from ideation onward. No more chucking features over the wall. No more islands. No more excuses. That’s continuous everything.

    Effective and comprehensive measurement and monitoring

    So you’ve got a CI/CD strategy. You’re shifting left. Now what? A critical – and often overlooked step in DevOps transformation is measurement. It’s time to take credit for how increasingly amazing you are doing! (or understand where you are falling short, DevOps is about honestly accepting and addressing failure or in efficiencies…together). You need visibility in order to know which lever to pull next in your path to continuous improvement. You’re delivering code faster than ever! But how’s the quality? Is it failing tests? Is it unstable in production? How much rework is required? You won’t know if you don’t track it. Implementing and measuring the success of the best practices in DevOps is crucial if you wish to make your automation cycle faster over time. If, like many, you jumped headlong into your DevOps journey without putting monitoring in place – it’s not too late. Consider keeping track of the deployment frequency, change lead time, change success/failure rate, mean time to recovery (MTTR), and the rate of security tests passes in your organization to stay on top of your DevOps transformation.

    8 CI/CD Best Practices to get you started in DevOps

    1. Take a ‘security first approach’

    It’s not possible to overemphasize the need for security in a world where breaches and vulnerabilities continue to cause massive reputation and financial losses to businesses of all sizes and capabilities. Since the CI/CD system offers access to your codebase and credentials to deploy in various environments, it is often the prime target. Recall the infamous Uber breach where hackers gained access to AWS credentials that were embedded in the GitHub software repository – stealing the personal information of 57 million users and 600,000 drivers. Uber then paid to cover it up, but that’s a different story. It’s certainly not uncommon for credentials to be stored in private repositories for automation purposes. Therefore, you should consider isolating your CI/CD systems, placing them in secure internal networks. VPNs, strong two-factor authentication and identity and access management systems will help you enforce ‘the principle of least privilege’ and restrict exposure to threats. For example, containerize your agents and place them on secure networks. In addition, you should also ensure that security is baked into the development process from start to finish. This is commonly known as DevSecOps.

    2. Assess your organization’s readiness to utilize a  microservices architecture

    For effective implementation of DevOps, a microservices architecture is the best way forward. However, re-architecting your existing applications can be a daunting task, and you may consider an incremental approach where you maintain your mission-critical systems and weave the new architecture around it. This will help you gradually replace the old system with the new architecture.

    3. Implement tracking and version control tools

    Tools like Jira and Bugzilla can help you achieve better visibility into the progress of your software and collaborate easily with distributed teams. You will also need a version control system like Git, which creates a ‘single source of truth’ for your team, allows tracking of changes in the code-base, and is a life-saver whenever a rollback is required. By enabling the teams to collaborate and integrate changes into the shared repository, GitOps can significantly improve your MTTR.

    4. Commit daily, reduce branching

    The goal of reducing (or even gasp… eliminating) branching is to spend more time on development and less time on version control. However, to make the most of GitOps, developers are expected to commit directly to the main branch or merge changes from their local branches in at least once a day. This will force developers to deal with smaller, bite-size bits of integration pain instead of the massive integration pain (and associated rework) that happens when attempting to merge many branches into the trunk just before release.

    5. Build only once

    Eliminate any practices where source code is built multiple times. Even if the software has to be built, packaged, or bundled, you should execute that step only once and promote your binaries. Most successful CI implementations include the build process as the first step in the CI/CD cycle to package the software in a clean environment. This eliminates oversights and reduces the chance for errors to be introduced and/or missed anytime later. Further, the resulting artifact should be versioned and uploaded to Git each time so that whenever it is pulled the build does not change.

    6. Decide which processes and tests to automate first

    While an incremental approach to automation sounds good, organizations transitioning from manual to automated processes often find it difficult to decide which processes to automate first. For example, it is beneficial to automate the process for compiling the code first. As developers need to commit code on a daily basis, it makes sense to do automated smoke tests. Unit tests are usually automated first to reduce the workload on developers.

    Consequently, you can automate functional testing, followed by UI testing. Functional tests do not usually require frequent updates in the automation script, unlike UI tests which have more frequent  changes. The main idea is to think about all possible dependencies and evaluate their impact to prioritize automation sensibly.

    7. Release often

    Frequent releases are only possible if the software is in a release-ready state and you have tested it in a production-like environment. That’s why the best practice is to add a deployment stage which closely resembles the production environment before the release. Some release best practices include:

    • Canary deployment. Releasing to a subset of users, testing with that base and rolling it out to the wider population if successful (or rolling it back for iteration if it’s not).

    • Blue green deployment. You begin with two identical production environments. One is live in production. The other is idle. When a new release is rolled out the changes are pushed to the idle environment. Then they switch – the environment containing the new release becomes the live environment. If something goes wrong, you can immediately roll back to the other environment (the one that does not contain the new release). If all is well – the environments are brought to parity once more.

    • A/B Testing. A/B testing is similar in flavor to – but not to be confused with- blue green deployments. A/B testing is a way of testing features within the application for things like usability. The better performing variant of the feature wins. This is not a release methodology.

    8. Use on-demand testing environments

    You should consider running tests in containers as this approach allows the quality assurance team to reduce the number of environment variables and changes present between the development and production environments. The primary advantage of using such ephemeral testing environments is that they add agility to your CI/CD cycle. The QA team does not have to pull a build from a CI server and install it in a separate testing environment; instead, it can run tests against a container image. It is much easier to spin up containers (they have no separate installation or configuration requirement) and also destroy them when not needed.

    Where to begin?

    The primary goal of DevOps or CI/CD best practices is to automate the process of building, testing and releasing software. This means you will need access to DevOps tools that help you simplify automation as well as get better visibility into the progress of your software. Further, there should be a mechanism to track DevOps performance metrics throughout the software delivery lifecycle and raise alerts for quick recovery when something goes wrong in release or deployment.

    Deciding which DevOps tools to implement and where to invest first can cause “analysis paralysis” – even in organizations that have been working through their DevOps transformation for some time. You can avoid getting stuck in a similar position and jumpstart your DevOps transformation with the CloudBees Starter Kit. Learn more about this starter kit here.

    Additional resources

     

  • Getting Webhooks Behind that Firewall of Yours

    Getting Webhooks Behind that Firewall of Yours

    In this post I’ll show you how to receive webhooks in real time from GitHub.com, even if your CloudBees Core stuff is behind a firewall. You can generalize this to other services too – such as BitBucket or DockerHub, or anything really that emits webhooks, but the instructions will be for GitHub projects hosted on github.com. The benefit, of course, is that you can use these public hosted services if you like, but your Core instances do not necessarily have to be directly open to the internet.

    What are webhooks

    Just a very quick refresher on what webhooks are: Messages (often JSON, but not always) typically posted by HTTP(S) from a server to a client that is listening for events.

    webhooks explainer

    The events flow left to right, Jenkins sits there happily listing on paths like /github-webhook/ or /dockerhub-webhook/ etc for some HTTP request to tell it to wake up and do some work.

    GitHub/BitBucket may be reporting a new commit or PR, or DockerHub reporting an upstream image has changed. What all these things have in common is that they push to Jenkins, and expect to be able to push to it (ie that Jenkins is visible to them). This works great when the network is open – say GitHub Enterprise, or Jenkins is listening on the web.

    Not on the web

    The trick is when something gets in the middle, say a firewall:

    firewall 1

    (As is industry standard, all firewalls have to be a wall on fire. Please don’t somehow set bricks on fire in your organization).

    This is just the same when you fire up Jenkins on your laptop, and want to receive webhooks from github.com (a legitimate thing, perhaps to test out your setup, perhaps to run builds for iOS on a mac, or some corner of a network that is not exposed to the web). Unless your laptop is addressable to the whole web that is (not likely), or your network is configured just right, the webhooks won’t be able to flow.

    This is fine – we can fall back to polling for changes. Except this is terrible. You burn through API quotas, and you don’t get changes in real time, and really no one is happy.

    Some problems are opportunities

    We can both solve this problem, but also, view this is an opportunity. Having things not addressable on the web, or locked down in some default way is a feature, not a bug. You massively reduce your attack surface, and can have defense in depth:

    exposed on the web

    A webhook forwarding service

    Enter the memorably named Smee. This is an OSS project provided by GitHub and also helpfully hosted as a service by GitHub. This can capture and forward webhooks for you. I’ll try to explain it with a diagram:

    firewall 2

    GitHub pushes an event (via HTTPS/json in this case) to Smee.io (the funny thing with circles, which is on the public web and accessible from GitHub.com) – and Jenkins in turn subscribes to Smee with an outgoing connection from a client. Note the direction of the arrows: Jenkins only makes an outbound connection.

    This is an important point: this will work as long as the firewall is one way (like a NAT typically is, and many networks). If the Jenkins side can’t connect to anything on the outside world – well, this won’t help with that of course (but that is not often the case).

    Setting it up

    Step 1: Firstly – go to https://smee.io/ and click “Start a new channel”:

    smeeio

    This will give you a unique URL (which you should copy for later use):

    smeeio url

    Next you should install the smee client next to where you have the Jenkins server running:

    npm install —global smee-client

    (This will make the smee client/command available to receive and forward webhooks).

    Now start the smee client and point it to your Jenkins server. In this case I have it running on port 8080 (the default if you fire it up on your laptop, change both the port and the smee URL as needed):

    smee —url https://smee.io/GSm1B40sRfBvSjYS —path /github-webhook/ —port 8080

    This says to connect to the smee service, and forward webhooks to /github-webhook/ (that trailing slash is important, don’t miss it). Once this is running, you will see it log that it is connected and forwarding webhooks. Leave this command running for as long as you want to receive webhooks.

    Next, you need to configure a pipeline that makes use of GitHub. In this case I set up one from scratch. You can skip this if you already have a pipeline setup:

    Jenkins pipeline setup

    I then chose “GitHub” as the where the code is:

    Github code store

    Then choose your repository. This will set things up ready to receive webhooks from GitHub. (If you have an existing pipeline setup, and it is using GitHub as the SCM source, that is also fine).

    The final step is to tell GitHub to post webhook events for that repository (or organization, you can do that too) to Smee (which ultimately means Jenkins will receive them).

    Go to the settings tab for your GitHub repository, and then click “add webhook”:

    GitHub to post webhook

    Next, configure the webhook:

    • Paste in the “smee” URL you copied from the step above.
    • Choose application/json as the content type.
    • Tell it to send everything (you can pick and choose what events, but I just did that as simpler).
    • Press Add Webhook (or update).

    It should look something like this:

    multibranch demo

    Webhooks should be flowing now. You can make a change to your repository, and check that a build starts soon after:

    app store demo webhooks

    Good luck!

    You can also get support from CloudBees for Jenkins if you need it.

    Additional resources