Chapter 6. Continuous integration: speeding up your development pipeline

 

This chapter covers

  • Using the Docker Hub workflow as a CI tool
  • Speeding up your IO-heavy builds
  • Using Selenium for automated testing
  • Running Jenkins within Docker
  • Using Docker as a Jenkins slave
  • Scaling your available compute with your dev team

In this chapter we’re going to look at various techniques that will use Docker to enable and improve your CI efforts.

By now you should understand how Docker is well suited to being used for automation. Its lightweight nature and the power it gives you to port environments from one place to another can make it a key enabler of continuous integration (CI). We’ve found the techniques in this chapter to be invaluable in making a CI process feasible within a business.

Making your build environment stable and reproducible, using testing tools requiring significant setup, and expanding your build capacity are all problems you may face, and Docker can help.

Continuous integration

In case you don’t know, continuous integration is a software lifecycle strategy used to speed up the development pipeline. By automatically rerunning tests every time a significant change is made to the codebase, you get faster and more stable deliveries because there’s a base level of stability in the software being delivered.

6.1. Docker Hub automated builds

Technique 55 Using the Docker Hub workflow

6.2. More efficient builds

Technique 56 Speed up I/O-intensive builds with eatmydata

Technique 57 Set up a package cache for faster builds

Technique 58 Running Selenium tests inside Docker

6.3. Containerizing your CI process

Technique 59 Containing a complex development environment

Technique 60 Running the Jenkins master within a Docker container

Technique 61 Scale your CI with Jenkins’ Swarm plugin

6.4. Summary