December 2017
Beginner to intermediate
362 pages
8h 35m
English
First, let us create pipeline code to create a Docker container (Jenkins slave), which will act as our build agent.
If you can recall, in the Adding Jenkins slaves – Docker containers section from Chapter 5, Distributed Builds, we learned to create a Docker image (maven-build-slave-0.1) that was meant for creating Docker containers (Jenkins slaves). We will use the same Docker image over here to spawn Jenkins Slave Agents for our CI pipeline.
In our Jenkinsfile, to spawn a Docker container (Jenkins slave) we need to write a code block for node with the label as docker:
node('docker') {}
Where docker is a label for the maven-build-slave-0.1 Docker template.
We would like to perform the following tasks ...
Read now
Unlock full access