chapter four

4 Baking Machine Images with Packer

 

This chapter covers

  • Overview of immutable infrastructure
  • Baking Jenkins machine images with Packer
  • Discovering Jenkins essentials plugins
  • Executing Jenkins Groovy scripts
  • Usage of Packer provisioners to automate Jenkins settings

In the previous chapter, we learned how Jenkins distributed mode architecture works. In this one, we will get our hands dirty and start deploying this architecture on AWS. As a quick reminder, we learned that the Jenkins cluster is divided into 2 main components: a master and worker components. Before diving into the implementation of the distributed builds architecture, we will deploy the standalone mode to cover some basics:

Figure 4.1. Jenkins standalone architecture on AWS

4.1      Immutable Infrastructure

4.2      Introducing Packer

4.2.1   How does it work?

4.2.2   Installation and configuration

4.2.3   Baking a Machine Image

4.3      Baking Jenkins Master AMI

4.3.1   Configuring Jenkins upon startup

4.3.2   Discovering Jenkins Plugins

4.4      Baking Jenkins Worker AMI

4.5      Summary