You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -52,48 +82,37 @@ Safety first, the host and token are stored in Drone Secrets.
52
82
* `sonar_host`: Host of SonarQube with schema(http/https).
53
83
* `sonar_token`: User token used to post the analysis report to SonarQube Server. Click User -- My Account -- Security -- Generate Tokens.
54
84
55
-
56
85
# Parameter Reference
57
86
58
-
* `sonar_name`: Sonar Project NAme.
87
+
* `sonar_name`: Sonar Project Name.
59
88
* `sonar_key`: Sonar Project Key.
60
89
* `sonar_qualitygate_timeout`: Timeout in seconds for Sonar Scan.
61
-
* `artifact_file`: Timeout in seconds for Sonar Scan.
62
-
* `sonar_quality_enabled`: True to block pipeline if sonar quality gate conditions are not met.
90
+
* `artifact_file`: Path to the artifact file that will be generated by the plugin.
91
+
* `sonar_quality_enabled`: True to block the pipeline if Sonar quality gate conditions are not met.
63
92
* `branch`: Branch for analysis. (-Dsonar.branch.name=)
64
93
* `build_number`: Build Version.
65
-
66
94
* `build_version`: Code version, Default value `DRONE_BUILD_NUMBER`.
67
-
* `timeout`: Default seconds `60`.
68
-
* `sources`: Comma-separated paths to directories containing source files.
69
-
* `inclusions`: Comma-delimited list of file path patterns to be included in analysis. When set, only files matching the paths set here will be included in analysis.
95
+
* `timeout`: Timeout in seconds, default `60`.
96
+
* `sources`: Comma-separated paths to directories containing source files.
97
+
* `inclusions`: Comma-delimited list of file path patterns to be included in analysis. Example: `*.go, *.java`.
70
98
* `exclusions`: Comma-delimited list of file path patterns to be excluded from analysis. Example: `**/static/**/*,**/dist/**/*.js`.
71
-
* `level`: Control the quantity / level of logs produced during an analysis. Default value `INFO`.
72
-
* DEBUG: Display INFO logs + more details at DEBUG level.
73
-
* TRACE: Display DEBUG logs + the timings of all ElasticSearch queries and Web API calls executed by the SonarQube Scanner.
99
+
* `level`: Control the quantity/level of logs produced during an analysis. Default value `INFO`. Options are `DEBUG` and `TRACE`.
74
100
* `showProfiling`: Display logs to see where the analyzer spends time. Default value `false` (-Dsonar.showProfiling=)
75
-
* `branchAnalysis`: Pass currently analysed branch to SonarQube. (Must not be active for initial scan!) Default value `false`
76
-
77
-
78
-
* `usingProperties`: Using the `sonar-project.properties` file in root directory as sonar parameters. (Not include `sonar_host` and
* `branchAnalysis`: Pass currently analyzed branch to SonarQube. (Must not be active for initial scan!) Default value `false`.
102
+
* `usingProperties`: Use the `sonar-project.properties` file in the root directory as sonar parameters. (Not including `sonar_host` and `sonar_token`.) Default value `false`.
103
+
* `binaries`: Path to application binaries (-Dsonar.java.binaries=).
104
+
* `sonar_config_file`: Use `sonar-project.properties` if available. Default value `false`.
105
+
* `sonar_config_file_override`: Use `sonar-project.properties` if available and override host, login, or project key settings. Default value `false`.
106
+
* `quality_gate_error_exit_code`: Specifies the "exit code" error when the quality gate fails. Default is `5`.
85
107
86
108
# Javascript Parameters
87
109
88
-
* `javascript_icov_reportPath`: Path to coverage report (-Dsonar.javascript.lcov.reportPath)
89
-
110
+
* `javascript_icov_reportPath`: Path to coverage report (-Dsonar.javascript.lcov.reportPath).
90
111
91
112
# Java Parameters
92
113
93
-
* `jacoco_report_path`: Path to Jacoco Report (if not default). (-Dsonar.jacoco.reportPath=)
94
-
95
-
* `java_coverage_plugin`: plugin to use as coverage. ex: jacoco (-Dsonar.java.coveragePlugin=)
96
-
114
+
* `jacoco_report_path`: Path to Jacoco Report (if not default). (-Dsonar.jacoco.reportPath=).
115
+
* `java_coverage_plugin`: Plugin to use as coverage, e.g., jacoco (-Dsonar.java.coveragePlugin=).
97
116
98
117
# Notes
99
118
@@ -102,7 +121,7 @@ Safety first, the host and token are stored in Drone Secrets.
102
121
* You could also add a file named `sonar-project.properties` at the root of your project to specify parameters.
Copy file name to clipboardExpand all lines: README.md
+55-11Lines changed: 55 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,41 @@
1
-
2
1
# Harness Drone/CIE SonarQube Plugin with Quality Gate
3
2
4
-
This plugin is designed to run SonarQube scans and handle the results and convert it to JUnit Format. It's written in Go and check the report results for status OK.
3
+
This plugin is designed to run SonarQube scans, handle the results, and convert them to JUnit format. It's written in Go and checks the report results for status OK.
4
+
5
+
## Main Features - v2.4.2
6
+
7
+
-**New Parameter: `sonar_config_file`**
8
+
-**Type**: Boolean
9
+
-**Description**: If set to true, the plugin will utilize the specified `sonar-project.properties` file for the SonarQube analysis, if it exists.
-**Description**: If set to true, the plugin will use the `sonar-project.properties` file and allow overriding of host, login, and/or project key settings.
- Sonar CLI downgraded from 6.0.0.4432 to 5.0.1.3006
9
28
- Execute SonarQube scans and handle the results
10
29
- Generate JUnit reports based on the scan results
11
30
- Quality Gate status reporting + Metrics
12
-
- Skip Scan and only check for quality Gate Status of a specific analysisId or last analysis
13
-
- Waiting for Analysis and QualityGate nows skip the wait if set to false - thanks @kangguru
14
-
- Added SONAR_SCANNER_OPTS as param, so it transform into this env var during execution for Sonar JVM params - check for the param detail section below
31
+
- Skip Scan and only check for Quality Gate status of a specific `analysisId` or last analysis
32
+
- Waiting for Analysis and QualityGate now skips the wait if set to false - thanks @kangguru
33
+
- Added `SONAR_SCANNER_OPTS` as a parameter, transforming into this env var during execution for Sonar JVM params - check the parameter detail section below
34
+
35
+
**Note**: Use `branch` and `pr_key` parameters for accurate results matching when skipping the scan.
15
36
16
-
Obs: USe branch and pr_key params for accuracy results matches when skiping the scan
0 commit comments