Extending our Jenkinsfile

We're going to change up our Jenkinsfile to support our new RSpec test. We're going to remove our original Test stage and be more clear by creating the Validate and Unit Test stages. We'll simply incorporate the two as pdk validate and pdk test unit:

pipeline {    agent any    stages {        stage('Validate') {            steps {                sh '/usr/local/bin/pdk validate'            }        }        stage ('Unit Test') {            steps {                sh '/usr/local/bin/pdk test unit'             }        }    }}

This will change our pipeline to three distinct phases: checkout SCM, Validate, and Unit Test. We'll be able to see where our build passes or fails along each step in Jenkins.

Now that we have a basic framework for our test laid out, let's get our code back to the remote repository:

[root@pe-puppet-master ...

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.