You can automate Packer image builds from a CI tool, thereby adding testing on code updates and scheduling builds. In this video, use your Jenkins server from the previous videos to automate the building of the image it's created from.
- [Instructor] As we're going to be running Packer…in a CI pipeline, I'm going to take advantage…of the validate command.…Validate performs basic syntax and configuration checks.…It's a good idea to validate a template after each change.…It'll return a non-zero result if it fails,…to it's perfect for incorporating into a CI process.…It means that we can quickly validate the change…or pool request, before continuing down…the very long process of building a template,…only for it to fail.…So if I take the template from the previous video,…where I was building Jenkins,…I can type packer validate, and the template name.…
And it validated successfully,…which I would expect, as we've just built it.…But it will also check to see if we've got…all the variables we need.…So if I had a dummy variable in here,…set it to null, and then run the packer validate again,…it will throw an error…and say this template doesn't validate,…because we haven't provided all the variables.…So we can use the var flag like we did with build.…
- What is Packer?
- Baking a website image for EC2
- Provisioning with a configuration management tool
- Building hardened images
- Building a pipeline for Packer images