Minimal Jenkinsfile for a Gradle Build
Starting work on a new project for a client, and their devops organization is off working on some new framework for CI/CD deploys. So in the meantime we just need a super minimal Jenkins build.Ā
The requirements I have for this are:
- Run the buildĀ
- Run the testsĀ
- Display test reportĀ
- Execute on every push to git, including PR branchesĀ
- Email failuresĀ
With that in mind, here is a quite minimal Jenkins script for our gradle build:
I'm not 100% sure if that last email block is needed, but it worked and I don't feel like messing with it.Ā
Also our builds are running against BitBucket using a Jenkins plugin, and even though we have it setup without needing polling, we still needed that Bitbucket poll hack. So here you go!