Skip to content

Instantly share code, notes, and snippets.

@AlexChesters
Last active July 13, 2017 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexChesters/2c5f3c2df3a6045497d7eb2b4210f0f5 to your computer and use it in GitHub Desktop.
Save AlexChesters/2c5f3c2df3a6045497d7eb2b4210f0f5 to your computer and use it in GitHub Desktop.
An example of a declarative Jenkins Pipeline
pipeline {
stages {
stage('Preparation') {
env.mvnHome = tool 'M3'
}
stage('Build') {
sh "'${mvnHome}/bin/mvn' -Dmaven.test.failure.ignore clean package"
}
}
post {
always {
junit '**/target/surefire-reports/TEST-*.xml'
archive 'target/*.jar'
}
success {
slackSend color: 'good', message: "$JOB_NAME - Successfully built #$BUILD_NUMBER (<$BUILD_URL|Open>)"
}
failure {
slackSend color: 'danger', message: "$JOB_NAME - Failed #$BUILD_NUMBER (<$BUILD_URL|Open>)"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment