aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMark Rekveld <mark.rekveld@sonarsource.com>2020-09-10 11:48:56 +0200
committersonartech <sonartech@sonarsource.com>2020-09-10 20:07:29 +0000
commit4efc3c9eebe2f0e7a19e2a2a0a6edb99572d0b2a (patch)
tree2468b3d846cef1cd65499e0befcff51600c3bfdc /server
parent8d88dee0dd0a886a454f1874166991f8c993b873 (diff)
downloadsonarqube-4efc3c9eebe2f0e7a19e2a2a0a6edb99572d0b2a.tar.gz
sonarqube-4efc3c9eebe2f0e7a19e2a2a0a6edb99572d0b2a.zip
[DOCS] Updated Sonar Scanner for Jenkins (#3129)
Diffstat (limited to 'server')
-rw-r--r--server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md
index e5a493009e9..5ca6c5a8180 100644
--- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md
+++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md
@@ -85,6 +85,14 @@ We provide a `withSonarQubeEnv` block that allows you to select the SonarQube se
If needed you can override the `credentialId` if you don't want to use the one defined in global configuration (for example if you define credentials at folder level).
+If you only need the SonarQube environment variables to be expanded in the build context then you can override the `envOnly` flag.
+```
+withSonarQubeEnv('My SonarQube Server', envOnly: true) {
+ // This expands the evironment variables SONAR_CONFIG_NAME, SONAR_HOST_URL, SONAR_AUTH_TOKEN that can be used by any script.
+ println ${env.SONAR_HOST_URL}
+}
+```
+
Here are a some examples for every scanner, assuming you run on Unix slaves and you have configured a server named "My SonarQube Server" as well as required tools. If you run on Windows slaves, just replace `sh` with `bat`.
SonarScanner: