Continuous Integration - Jenkins

Overview

On Thursday 4th May Peter Bartram and Samuel Diserens presented a workshop on the practice of Continuous Integration and the use of the open-source software Jenkins . This workshop aimed to introduce participants to some of the key concepts of continuous integration as well as to provide participants with an entry-level knowledge of Jenkins which would enable them to get started and experiment further on their own.

Continuous Integration

The idea of Continuous Integration is to continually introduce small incremental changes to a software project while regularly building and testing the code. This is compared to merging large completed features into the build and only testing when the development work is completed.

“Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.” - ThoughtWorks

The advantages of this are:

  • Identify conflicts early when multiple developers are committing to the same codebase.
  • Reduces the time taken to find bugs.
    • Finding a bug in 10 lines of code is much easier than finding one in 1,000.
  • Testing can be automated, and scheduled to run e.g. daily to identify regression.


Jenkins

Jenkins is one of the most commonly used solutions for continuous integration. It is a web based server tool with the ability to:

  • Build code
  • Parse for warnings / errors
  • Run unit tests
  • Display results
  • Generate documentation
  • Handle code releases

Jenkins Server/ Client Model
A diagram showing the Jenkins server/client model

Workshop

The workshop consisted of a set of exercises to complete on a virtual machine (see below). A basic Jenkins server had been set up on the machine and participants were walked through the basics of:

  • Accessing the server
  • Installing plugins
  • Creating a new build project and linking to an existing git repository
  • Executing simple scripts within the job
  • Building on a GiT commit
  • Building at time intervals
  • Running and fixing unit testing


Content

blogroll

social