Last active
January 4, 2017 05:15
-
-
Save velocity303/7810f7277e424fcba131b9f6320af636 to your computer and use it in GitHub Desktop.
Jenkinsfile for Puppet Testing with Pipeline Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
stage ('Checkout Control Repo') { | |
git url: 'https://github.com/velocity303/demo-control-repo.git', branch: 'production' | |
} | |
stage ('Check Style') { | |
sh 'echo $(find . -type f -name "*.pp" \\( -exec /opt/puppetlabs/puppet/bin/puppet-lint --with-filename {} \\; -o -quit \\) 2>&1 ) | grep -v ERROR' | |
} | |
stage ('Check Syntax') { | |
sh 'echo $(find . -type f -name "*.pp" \\( -exec /opt/puppetlabs/bin/puppet parser validate {} \\; -o -quit \\) 2>&1 ) | grep -v Error' | |
} | |
stage ('Authorize deployment') { | |
puppet.credentials 'pe-access-token' | |
} | |
stage ('Deploy to production') { | |
puppet.codeDeploy 'production' | |
} | |
stage ('Deploy change to production') { | |
puppet.job 'production', query: 'nodes { catalog_environment = "production" }' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment