diff --git a/README.md b/README.md index ebfc7b02fe071b4bda846fe78e96d9e985359401..4246e2d0f468ed931f5f06b6b27a7b527d57c419 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ It is bound to the `test` stage, and uses the following variables: | :lock: `SONAR_LOGIN` | SonarQube login (depends on your authentication method) | _none_ | | :lock: `SONAR_PASSWORD` | SonarQube password (depends on your authentication method) | _none_ | | `SONAR_BASE_ARGS` | SonarQube [analysis arguments](https://docs.sonarqube.org/latest/analysis/analysis-parameters/) | `-Dsonar.links.homepage=${CI_PROJECT_URL} -Dsonar.links.ci=${CI_PROJECT_URL}/-/pipelines -Dsonar.links.issue=${CI_PROJECT_URL}/-/issues` | +| `SONAR_QUALITY_GATE_ENABLED` | Set to `true` to enable SonarQube [Quality Gate](https://docs.sonarqube.org/latest/user-guide/quality-gates/) verification.<br/>_Uses `sonar.qualitygate.wait` parameter ([see doc](https://docs.sonarqube.org/latest/analysis/ci-integration-overview/#header-1))._ | _none_ (disabled) | ### Automatic Branch Analysis & Merge Request Analysis diff --git a/kicker.json b/kicker.json index d1214cc8b0c020748e4d97bb9be5ee57798fdf9e..d3d38abf7e137de49242eaa55e495cda99d36692 100644 --- a/kicker.json +++ b/kicker.json @@ -45,6 +45,11 @@ "description": "SonarQube [analysis arguments](https://docs.sonarqube.org/latest/analysis/analysis-parameters/)", "default": "-Dsonar.links.homepage=${CI_PROJECT_URL} -Dsonar.links.ci=${CI_PROJECT_URL}/-/pipelines -Dsonar.links.issue=${CI_PROJECT_URL}/-/issues", "advanced": true + }, + { + "name": "SONAR_QUALITY_GATE_ENABLED", + "description": "Enables SonarQube [Quality Gate](https://docs.sonarqube.org/latest/user-guide/quality-gates/) verification.\n\n_Uses `sonar.qualitygate.wait` parameter ([see doc](https://docs.sonarqube.org/latest/analysis/ci-integration-overview/#header-1))._", + "type": "boolean" } ] } diff --git a/templates/gitlab-ci-sonar.yml b/templates/gitlab-ci-sonar.yml index e6955875a683ccc59c973f13aae3d8878e9e5073..5df42b0bc87b2fb9b7e9137829d3e55b5da859fc 100644 --- a/templates/gitlab-ci-sonar.yml +++ b/templates/gitlab-ci-sonar.yml @@ -308,6 +308,7 @@ sonar: ${SONAR_PASSWORD+-Dsonar.password=$SONAR_PASSWORD} ${SONAR_PROJECT_KEY+-Dsonar.projectKey=$SONAR_PROJECT_KEY} ${SONAR_PROJECT_NAME+-Dsonar.projectName=$SONAR_PROJECT_NAME} + ${SONAR_QUALITY_GATE_ENABLED+-Dsonar.qualitygate.wait=$SONAR_QUALITY_GATE_ENABLED} $SONAR_BASE_ARGS rules: - !reference [.test-policy, rules]