From 9ac1ecab6661c86069e5e63e8cb31a885022e91a Mon Sep 17 00:00:00 2001 From: Jeff Zapotoczny <47899134+jeff-zapotoczny-sonarsource@users.noreply.github.com> Date: Mon, 1 Mar 2021 06:56:05 -0500 Subject: [PATCH] Updating docs for clarity around self-signed certs and GitLab (#3811) * Updating docs for clarity around self-signed certs and GitLab * Update server/sonar-docs/src/pages/analysis/gitlab-integration.md Co-authored-by: MikeBirnstiehl * Update server/sonar-docs/src/pages/analysis/scan/sonarscanner.md Co-authored-by: MikeBirnstiehl Co-authored-by: MikeBirnstiehl --- .../src/pages/analysis/gitlab-integration.md | 10 ++++++++-- .../src/pages/analysis/scan/sonarscanner.md | 14 +++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/server/sonar-docs/src/pages/analysis/gitlab-integration.md b/server/sonar-docs/src/pages/analysis/gitlab-integration.md index a3a99f24d0f..d17b549a424 100644 --- a/server/sonar-docs/src/pages/analysis/gitlab-integration.md +++ b/server/sonar-docs/src/pages/analysis/gitlab-integration.md @@ -168,7 +168,13 @@ Click the scanner you're using below to expand the example configuration: | - develop | ``` | -| **Note:** A project key has to be provided through `sonar-project.properties` or through the command line parameter. For more information, see the [SonarScanner](/analysis/scan/sonarscanner/) documentation. +| +| **Project key** +| A project key has to be provided through `sonar-project.properties` or through the command line parameter. For more information, see the [SonarScanner](/analysis/scan/sonarscanner/) documentation. +| +| **Self-signed certificates** +| If you secure your SonarQube instance with a self-signed certificate, you may need to build a custom image based on `sonarsource/sonar-scanner-cli`. See the section **Advanced Docker Configuration** within the [SonarScanner](/analysis/scan/sonarscanner/) documentation. +| #### **Failing the pipeline job when the Quality Gate fails** In order for the Quality Gate to fail on the GitLab side when it fails on the SonarQube side, the scanner needs to wait for the SonarQube Quality Gate status. To enable this, set the `sonar.qualitygate.wait=true` parameter in the `.gitlab-ci.yml` file. @@ -225,4 +231,4 @@ From here, set your: [[collapse]] | ## Linking issues -| During pull request decoration, individual issues will be linked to their SonarQube counterparts automatically. For this to work correctly, you need to set the instance's **Server base URL** (**[Administration > Configuration > General Settings > General > General](/#sonarqube-admin#/admin/settings/)**) correctly. Otherwise, the links will default to `localhost`. \ No newline at end of file +| During pull request decoration, individual issues will be linked to their SonarQube counterparts automatically. For this to work correctly, you need to set the instance's **Server base URL** (**[Administration > Configuration > General Settings > General > General](/#sonarqube-admin#/admin/settings/)**) correctly. Otherwise, the links will default to `localhost`. diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md index 6d0aa4cf907..16d1c2616db 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md @@ -165,6 +165,19 @@ The following sections offer advanced configuration options when running the Son | -v `pwd`/cacerts:/opt/java/openjdk/lib/security/cacerts \ | sonarsource/sonar-scanner-cli | ``` +| +| Alternatively, you can create your own container that includes the modified `cacerts` file. Create a `Dockerfile` with the following contents: +| +| ``` +| FROM sonarsource/sonar-scanner-cli +| COPY cacerts /opt/java/openjdk/lib/security/cacerts +| ``` +| +| Then, assuming both the `cacerts` and `Dockerfile` are in the current directory, create the new image with a command such as: +| ``` +| docker build --tag our-custom/sonar-scanner-cli . +| ``` +| ## Troubleshooting **Java heap space error or java.lang.OutOfMemoryError** @@ -182,4 +195,3 @@ Upgrade the version of Java being used for analysis or use one of the native pac **Property missing: `sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.** Scanner CLI is not able to analyze .NET projects. Please, use the SonarScanner for .NET. If you are running the SonarScanner for .NET, ensure that you are not hitting a known limitation. - -- 2.39.5