feat(Sonar 8): Add Sonar 8 Support and Documentation.
This commit is contained in:
parent
9acbb1ba46
commit
83aada8d2c
@ -1,7 +1,8 @@
|
|||||||
:sourcedir: ../../../../templates/
|
:sourcedir: ../../../../templates/
|
||||||
= sonar-template
|
= Sonar 7
|
||||||
|
|
||||||
The following templates provide integrations for Sonar
|
The following templates provide integrations for Sonar
|
||||||
|
More Details can be found here: https://www.exxcellent.de/confluence/x/RIWCC[Confluence: Sonar Plugin Setup].
|
||||||
|
|
||||||
.Variables
|
.Variables
|
||||||
|===
|
|===
|
||||||
@ -22,5 +23,5 @@ Wenn der Build nicht gebrochen werden soll, kann es weggelassen werden.
|
|||||||
.sonar-template
|
.sonar-template
|
||||||
[source,yaml]
|
[source,yaml]
|
||||||
----
|
----
|
||||||
include::{sourcedir}static-analysis/sonar.gitlab-ci.yml[]
|
include::{sourcedir}static-analysis/sonar-7.gitlab-ci.yml[]
|
||||||
----
|
----
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
:sourcedir: ../../../../templates/
|
||||||
|
= Sonar 8
|
||||||
|
|
||||||
|
The following templates provide integrations for Sonar
|
||||||
|
More Details can be found here: https://www.exxcellent.de/confluence/x/RIWCC[Confluence: Sonar Plugin Setup].
|
||||||
|
|
||||||
|
.Variables
|
||||||
|
|===
|
||||||
|
|Name |Description | Default Value
|
||||||
|
|SONAR_HOST_URL | The Url for the Sonar server | https://sonar.exxcellent.de/sonar8
|
||||||
|
|SONAR_TOKEN | The Sonar token to call protected sonar functions | ""
|
||||||
|
|SONAR_PROJECT_KEY | The Sonar-Projekt-Key of your Project. | ""
|
||||||
|
|SONAR_PROJECT_NAME | The Sonar-Projekt-Name. | "" (Es wird dann standardmäßig der Maven project.name verwendet)
|
||||||
|
|SONAR_EXCLUSIONS | Paths that will not be scanned by Sonar | **/target/**,**/src/test/**
|
||||||
|
|SONAR_QUALITYGATE_WAIT | Defines if the quality-gate should be considered while evaluation.
|
||||||
|
Has to be `true` if the quality-gate should fail your pipelines. Please consider setting `allow_failure` to `true` if your pipeline shouldn't fail but the quality gate should be still called. | true
|
||||||
|
|SONAR_QUALITYGATE_TIMEOUT | Define the timeout time when the quality-gate should be timing out. | 10000
|
||||||
|
|
||||||
|
|===
|
||||||
|
|
||||||
|
.sonar-template
|
||||||
|
[source,yaml]
|
||||||
|
----
|
||||||
|
include::{sourcedir}static-analysis/sonar-8.gitlab-ci.yml[]
|
||||||
|
----
|
||||||
@ -104,7 +104,7 @@ include::chapters/templates/java/gradle/gradle-db-diff-template.adoc[leveloffset
|
|||||||
With the following collection we provide Static code and Artefact analysis tools.
|
With the following collection we provide Static code and Artefact analysis tools.
|
||||||
|
|
||||||
include::chapters/templates/static-analysis/repo-cve-scan.adoc[leveloffset=2]
|
include::chapters/templates/static-analysis/repo-cve-scan.adoc[leveloffset=2]
|
||||||
include::chapters/templates/static-analysis/tool-sonar.adoc[leveloffset=2]
|
include::chapters/templates/static-analysis/sonar-7.adoc[leveloffset=2]
|
||||||
|
|
||||||
== Documentation
|
== Documentation
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,13 @@ include:
|
|||||||
- '/templates/java/gradle/gradle-build.gitlab-ci.yml'
|
- '/templates/java/gradle/gradle-build.gitlab-ci.yml'
|
||||||
- '/templates/java/gradle/gradle-verify.gitlab-ci.yml'
|
- '/templates/java/gradle/gradle-verify.gitlab-ci.yml'
|
||||||
- '/templates/static-analysis/repo-cve-scan-trivy.gitlab-ci.yml'
|
- '/templates/static-analysis/repo-cve-scan-trivy.gitlab-ci.yml'
|
||||||
- '/templates/static-analysis/sonar.gitlab-ci.yml'
|
- '/templates/static-analysis/sonar-8.gitlab-ci.yml'
|
||||||
|
|
||||||
|
# todo docs
|
||||||
|
|
||||||
|
# todo Variablen die gesetzt werden müssen
|
||||||
|
# variables:
|
||||||
|
# SONAR_PROJECT_KEY: ""
|
||||||
|
|
||||||
Build-Java:
|
Build-Java:
|
||||||
extends: .gradle-build
|
extends: .gradle-build
|
||||||
@ -23,5 +29,4 @@ sonar:
|
|||||||
- job: "Build-Java"
|
- job: "Build-Java"
|
||||||
artifacts: true
|
artifacts: true
|
||||||
variables:
|
variables:
|
||||||
SONAR_PROJECT_KEY: $CI_PROJECT_NAME
|
|
||||||
SONAR_PROJECT_NAME: $CI_PROJECT_NAME
|
SONAR_PROJECT_NAME: $CI_PROJECT_NAME
|
||||||
|
|||||||
@ -4,9 +4,11 @@ include:
|
|||||||
- '/templates/java/maven/maven-verify.gitlab-ci.yml'
|
- '/templates/java/maven/maven-verify.gitlab-ci.yml'
|
||||||
- '/templates/java/maven/maven-database-diff.gitlab-ci.yml'
|
- '/templates/java/maven/maven-database-diff.gitlab-ci.yml'
|
||||||
- '/templates/static-analysis/repo-cve-scan-trivy.gitlab-ci.yml'
|
- '/templates/static-analysis/repo-cve-scan-trivy.gitlab-ci.yml'
|
||||||
- '/templates/static-analysis/sonar.gitlab-ci.yml'
|
- '/templates/static-analysis/sonar-8.gitlab-ci.yml'
|
||||||
|
|
||||||
# todo doc welche Variablen gesetzt werden müssen.before_script:
|
# todo docs
|
||||||
|
|
||||||
|
# todo Variablen die gesetzt werden müssen
|
||||||
# variables:
|
# variables:
|
||||||
# SONAR_PROJECT_KEY: ""
|
# SONAR_PROJECT_KEY: ""
|
||||||
|
|
||||||
@ -25,12 +27,13 @@ Test-Java:
|
|||||||
- job: "Build-Java"
|
- job: "Build-Java"
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
|
||||||
Database-Diff:
|
#todo put this into backend template
|
||||||
extends:
|
#Database-Diff:
|
||||||
- .maven-database-diff
|
# extends:
|
||||||
needs:
|
# - .maven-database-diff
|
||||||
- job: "Build-Java"
|
# needs:
|
||||||
artifacts: true
|
# - job: "Build-Java"
|
||||||
|
# artifacts: true
|
||||||
|
|
||||||
Repo-CVE-Scan:
|
Repo-CVE-Scan:
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
@ -42,5 +45,4 @@ Sonar:
|
|||||||
- job: "Build-Java"
|
- job: "Build-Java"
|
||||||
artifacts: true
|
artifacts: true
|
||||||
variables:
|
variables:
|
||||||
SONAR_PROJECT_KEY: $CI_PROJECT_NAME
|
|
||||||
SONAR_PROJECT_NAME: $CI_PROJECT_NAME
|
SONAR_PROJECT_NAME: $CI_PROJECT_NAME
|
||||||
|
|||||||
35
templates/static-analysis/sonar-8.gitlab-ci.yml
Normal file
35
templates/static-analysis/sonar-8.gitlab-ci.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
.sonar-template-common:
|
||||||
|
stage: test
|
||||||
|
variables:
|
||||||
|
SONAR_HOST_URL: https://sonar.exxcellent.de/sonar8
|
||||||
|
SONAR_PROJECT_KEY: ""
|
||||||
|
SONAR_PROJECT_NAME: ""
|
||||||
|
SONAR_EXCLUSIONS: "**/target/**,**/src/test/**"
|
||||||
|
SONAR_QUALITYGATE_WAIT: "true"
|
||||||
|
SONAR_QUALITYGATE_TIMEOUT: "10000"
|
||||||
|
|
||||||
|
.sonar-template:
|
||||||
|
extends: .sonar-template-common
|
||||||
|
image: $MAVEN_IMAGE
|
||||||
|
script:
|
||||||
|
- mvn $MAVEN_CLI_OPTS test sonar:sonar
|
||||||
|
"-Dsonar.host.url=$SONAR_HOST_URL"
|
||||||
|
"-Dsonar.login=$SONAR_TOKEN"
|
||||||
|
"-Dsonar.projectKey=$SONAR_PROJECT_KEY"
|
||||||
|
"-Dsonar.projectName=$SONAR_PROJECT_NAME"
|
||||||
|
"-Dsonar.exclusions=$SONAR_EXCLUSIONS"
|
||||||
|
"-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT"
|
||||||
|
"-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT"
|
||||||
|
|
||||||
|
.sonar-template-gradle:
|
||||||
|
extends: .sonar-template-common
|
||||||
|
image: $GRADLE_IMAGE
|
||||||
|
script:
|
||||||
|
- ./gradlew $GRADLE_OPTS $GRADLE_CLI_OPTS sonarqube
|
||||||
|
"-Dsonar.host.url=$SONAR_HOST_URL"
|
||||||
|
"-Dsonar.login=$SONAR_TOKEN"
|
||||||
|
"-Dsonar.projectKey=$SONAR_PROJECT_KEY"
|
||||||
|
"-Dsonar.projectName=$SONAR_PROJECT_NAME"
|
||||||
|
"-Dsonar.exclusions=$SONAR_EXCLUSIONS"
|
||||||
|
"-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT"
|
||||||
|
"-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT"
|
||||||
Loading…
Reference in New Issue
Block a user