Cybersecurity
DevOps Cloud
IT Operations Cloud
One of our tech support representatives, Richard Pinaroc, offers a Jenkins pipeline example on how to fail a job if the number of priority issues surpasses a certain threshold. This has also been published as a KB article https://softwaresupport.softwaregrp.com/doc/KM03660119.
[Pipeline] stage [Pipeline] { (Check Criticals) [Pipeline] bat C:\Jenkins\workspace\Jenkins_Pipeline_Example> C:\Jenkins\workspace\test.bat "C:\Jenkins\workspace\Jenkins_Pipeline_Example\scan.fpr" [2020-06-29T14:00:05 INFO] Log4j2 was configured successfully [2020-06-29T14:00:05 INFO] Performing search on project: C:\Jenkins\workspace\Jenkins_Pipeline_Example\scan.fpr [2020-06-29T14:00:05 INFO] Properties file does not exist in user directory third-party-parsers.properties [2020-06-29T14:00:06 INFO] Embedded external metadata file loaded [2020-06-29T14:00:06 INFO] Properties file does not exist in user directory fortify.properties [2020-06-29T14:00:06 INFO] Properties file does not exist in user directory fortify.properties [2020-06-29T14:00:08 INFO] Default issue template loaded [2020-06-29T14:00:08 INFO] Properties file does not exist in user directory custom.groupings.properties [2020-06-29T14:00:09 INFO] Properties file does not exist in user directory issue-correlation.properties [2020-06-29T14:00:09 WARN] WARNING: LocalExecutorService is using 8 of 8 possible threads for processing. [2020-06-29T14:00:10 INFO] SCAIntegrationUtil not initialized [2020-06-29T14:00:10 INFO] SCAIntegrationUtil not initialized [2020-06-29T14:00:11 INFO] Total Issue Count: 7 [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Upload to SSC) Stage "Upload to SSC" skipped due to earlier failure(s) [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code 1 Finished: FAILURE