Created
December 8, 2020 22:31
-
-
Save jeffsheets/60effa1b85b7fcc1d084f214427a5975 to your computer and use it in GitHub Desktop.
Minimal Gradle Jenkinsfile
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
//Inspired by https://gist.github.com/aerobless/37561bb0fb45b7e8732beaafad1cba26 | |
pipeline { | |
agent any | |
triggers { | |
//Needed by Bitbucket to see the builds on PRs https://stackoverflow.com/a/54710254 | |
pollSCM('') | |
} | |
stages { | |
stage('test') { | |
steps { | |
script { | |
sh './gradlew clean check --stacktrace' | |
junit '**/build/test-results/test/*.xml' | |
} | |
} | |
} | |
} | |
post { | |
always { //Send an email to the person that broke the build | |
step([$class : 'Mailer', | |
notifyEveryUnstableBuild: true, | |
recipients : [emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])].join(' '), | |
sendToIndividuals: true]) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment