Must-share information (formatted with Markdown):
-
SonarQube v8.6
-
what are you trying to achieve
I want to run SonarQube from command line and get exit code if I get errors in code analysis. -
So if analysis is completely successfull exit code 0
-
if some error was found exit code != 0 is thrown.
-
what have you tried so far to achieve this
I have sonarqube running on docker and am able to run it locally and get:
INFO: CPD Executor 4 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 3 files
INFO: CPD Executor CPD calculation finished (done) | time=11ms
INFO: Analysis report generated in 74ms, dir size=97 KB
INFO: Analysis report compressed in 46ms, zip size=21 KB
INFO: Analysis report uploaded in 34ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=foo
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://localhost:9000/api/ce/task?id=example
INFO: Analysis total time: 18.668 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 19.616s
INFO: Final Memory: 12M/50M
INFO: ------------------------------------------------------------------------
[11:10:42] Analysis finished.