Skip to content

Instantly share code, notes, and snippets.

@jeffsheets
Created December 8, 2020 22:31
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 jeffsheets/60effa1b85b7fcc1d084f214427a5975 to your computer and use it in GitHub Desktop.
Save jeffsheets/60effa1b85b7fcc1d084f214427a5975 to your computer and use it in GitHub Desktop.
Minimal Gradle Jenkinsfile
//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