Exercises
You learned a lot about Jenkins configuration throughout this chapter. To consolidate your knowledge, we recommend the following exercises on preparing Jenkins images and testing the Jenkins environment:
- Create Jenkins master and agent Docker images and use them to run a Jenkins infrastructure capable of building Ruby projects:
- Create the Jenkins master Dockerfile, which automatically installs the Docker plugin.
- Build the master image and run the Jenkins instance.
- Create the agent Dockerfile (suitable for the dynamic agent provisioning), which installs the Ruby interpreter.
- Build the agent image.
- Change the configuration in the Jenkins instance to use the agent image.
- Create a pipeline that runs a Ruby script printing
Hello World from Ruby
:- Create a new pipeline.
- Use the following shell command to create the
hello.rb
script on the fly:
sh "echo \"puts 'Hello World from Ruby'\" > hello.rb"
- Add the command...