How can I track values between Jenkins Builds (Static Analysis) How can I track values between Jenkins Builds (Static Analysis) jenkins jenkins

How can I track values between Jenkins Builds (Static Analysis)


You can use the Groovy Postbuild Plugin:

https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin

It lets you extract data (such as number of vulnerabilities detected) from the current build's buildlog with num_vul = manager.getLogMatcher(regexp)

And compare that to previous builds, by extracting info from their buildlog, e.g.:

currentBuildNumber = manager.build.numbermanager.setBuildNumber(currentBuildNumber - 1)prev_num_vul = manager.getLogMatcher(regexp)

Then, if the number of vulnerabilities had gone up, I would call manager.buildFailure() which sets the build status to FAILURE, and then have the next PostBuild step be to the Email-ext plugin which allows you to send email to the committer in the event of a failure.


I would recommend the SonarQube tool, which does just what you describe. You mention that you already looked at it, but maybe you missed the Notifications feature or the Build Breaker Plugin. There are more SonarQube features centered around Jenkins integration. SonarQube is free to use.

If you are still missing something, it might be worthwhile asking specifically how that aspect could be covered by SonarQube. Just my two cents.