Last active
July 13, 2017 21:24
-
-
Save AlexChesters/2c5f3c2df3a6045497d7eb2b4210f0f5 to your computer and use it in GitHub Desktop.
An example of a declarative Jenkins Pipeline
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
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