These scripts, using Hashicorp Packer, prepare a Google Cloud Image that can be used for a Jenkins Agent to build a Java project (which in this case also requires Node, Docker, and Google Chrome for running WebDriver tests).
I find that using Packer to create the image has several advantages over using Docker images for build steps, namely:
- Faster start up, and can be used together with stateful build agents.
- Build logic can fully live in our Gradle scripts rather .yaml build steps each with a different Docker container
However, it does make upgrading toolsets a bit more time consuming than just changing the Docker image.