Jenkins CI

Here at BridgePoint, we have used Jenkins (https://jenkins.io/index.html) with great success both as a tool for continuous integration and for application deployments.

Continuous integration is a development practice that starts by requiring developers to check in source code changes on a regular basis- multiple times per day is optimal for this process. Check ins prompt an automated system to check out that particular copy of the code, and attempt to compile it. Once compiled, unit tests are executed to ensure the correctness of the application. The results, whether successful or not, are reported back to the team. The idea is that the team can capitalize on the quicker- and automated- feedback to reduce errors in the code base that would otherwise wait unnoticed for some period of time.

Jenkins is a tool to perform this automation. Distributed as a self-contained Java application, Jenkins is capable of integrating with a wide variety of tools via off the shelf plugins or through shell scripting. Jenkins considers a particular project’s process as a job to be executed. The typical job for a CI project BridgePoint works on involves these steps:

  • Poll a git repo at regular intervals looking for changes, when found:
  • Check out that branch
  • Compile it
  • Run any unit tests
  • Generate doxygen output
  • Report results

Jenkins will automatically record build history, and contains plugins for email notifications. Jenkins is intended to be accessed via a web browser; a REST API is provided for those wishing to integrate with other tools.

A typical Jenkins overview

A typical Jenkins overview

Because Jenkins is essentially a system for readily creating automated jobs to run, BridgePoint also uses Jenkins as a deployment tool. The process is similar to a CI build, however we trade the automatic polling for a manual trigger and have added the appropriate deployment steps:

  • Check out a predetermined branch from a git repo when ordered to, and:
  • Compile it
  • Run any unit tests
  • Generate doxygen output
  • Execute Visual Studio publish step
  • Use rsync to deploy to one or more production environments
  • For production releases, also
    • Merge to the master branch
    • Tag the commit with a unique identifier linked to this particular Jenkins job execution
    • Push both back to the repo
  • Report results

Do not let my use of Visual Studio deter your judgement.  Jenkins is a very capable cross-environment app, functioning equally well executing maven or composer in a Linux environment as it would running msbuild or robocopy in a Windows environment.

BridgePoint is a Microsoft Cloud Solution Provider specializing in Office 365 and Azure.  We can help set up Jenkins for your organization, regardless of whether or not your production environment is hosted by our IT Managed Services team.  We’ve already helped several clients with varying environments use Jenkins to automate their processes.  Let our experts help you find the best path to improve!