Automated deployment pipelines with Jenkins and Puppet

By Eric Smalling

Elevator Pitch

One of the more challenging problems in most deployment pipelines is tracking application artifacts after they are built. Using a few Jenkins plugins, a Maven repository and Puppet, we will demonstrate a way to know precisely where and when your builds get deployed throughout your environments.

Description

The goal of continuous deployment is to automate the entire software delivery pipeline from the moment code is committed, through various testing stages, and finally deploying to production. As build artifacts move through your pipeline stages it is often difficult to determine where and when any given one of them got deployed. This difficulty is compounded if out-of-band or “eventually consistent” technologies (like Puppet) are used in the deployment processes.

In this deep-dive session, you will learn how to set up Jenkins and Puppet to track artifact deployment and provide a single point of reference for the lifecycle of every build.

Notes

For the past 1.5 years, I’ve been doing Puppet & Jenkins related consulting with one of the world’s largest airlines and am leveraging lessons learned there for much of this presentation.

The demonstration setup will consist of the following, all likely running in containers via Docker Compose on my laptop with cached images to avoid any network issues: * a Jenkins LTS server * GitLab * Artifactory or Nexus * OSS Puppet Master * a few Puppet managed node machines to simulate various environments.

In advance of the demo I’ll have: * The Puppet managed nodes pre-classified with the Puppet server for various “environments” * Puppet manifests written to deploy the a .war file using either the Puppet Archive or Maven modules (Archive is supposed to me able to deploy from Nexus and Artifactory now, if it works I’ll use that, otherwise I’ll use the Maven module that I’ve used at my last client.) * A simple, “hello world” Java web app with embedded Jetty in a local GitLab repo with Maven or Gradle based build * Possibly some simple HttpUnit based “smoke” and/or “functional” tests

During the session, I’ll show a Jenkins pipeline with stages as follows: 1. Build: .war file build from a GitLab repo and deployed to the maven repo 1. Smoke test: Puppet mcollective triggered deployment to test vm/container and simple HttpUnit validation

The following 3 stages to run in parallel 1. Functional test: Same as above with a few other tests (simulating longer running tests) 1. Performance test: Same as deployment as above with synthetic load driven by JMeter or similar tool 1. UAT test: Same deployment as above with manual gate to go on

Manual gate here 1. Production deploy: Same as smoke above but to production node (smoke test run against prod for sanity test)