]> source.dussan.org Git - sonarqube.git/blob
0bf465301ee3c915f34d8ea0205fa615df58f072
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should follow and complete all steps: Dart: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
4
5 exports[`should follow and complete all steps: Dart: bitbucket-pipelines.yml 1`] = `
6 "image: ghcr.io/cirruslabs/flutter:stable
7
8 definitions:
9   steps:
10     - step: &build-step
11         name: Build the project, and run the SonarQube analysis
12         script:
13           - <commands to build your project>
14           - export SONAR_SCANNER_VERSION=6.1.0.4477
15           - mkdir $HOME/.sonar
16           - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-x64.zip
17           - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
18           - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-x64/bin"
19           - sonar-scanner
20   caches:
21     sonar: ~/.sonar
22
23 clone:
24   depth: full
25
26 pipelines:
27   branches:
28     '{main}':
29       - step: *build-step
30
31   pull-requests:
32     '**':
33       - step: *build-step"
34 `;
35
36 exports[`should follow and complete all steps: .NET: bitbucket-pipelines.yml 1`] = `
37 "image: mcr.microsoft.com/dotnet/sdk:7.0
38
39 definitions:
40   steps:
41     - step: &build-step
42         name: SonarQube analysis
43         caches:
44           - dotnetcore
45           - sonar
46         script:
47           - dotnet tool install --global dotnet-sonarscanner
48           - export PATH="$PATH:/root/.dotnet/tools"
49           - dotnet sonarscanner begin /k:"my-project" /d:"sonar.token=\${SONAR_TOKEN}"  /d:"sonar.host.url=\${SONAR_HOST_URL}"
50           - dotnet build 
51           - dotnet sonarscanner end /d:"sonar.token=\${SONAR_TOKEN}"
52   caches:
53     sonar: ~/.sonar
54
55 pipelines:
56   branches:
57     '{main}':
58       - step: *build-step
59
60   pull-requests:
61     '**':
62       - step: *build-step"
63 `;
64
65 exports[`should follow and complete all steps: C++ (automatic) and other: .github/workflows/build.yml 1`] = `
66 "image: maven:3.3.9
67
68 definitions:
69   steps:
70     - step: &build-step
71         name: SonarQube analysis
72         script:
73           - pipe: sonarsource/sonarqube-scan:2.0.1
74             variables:
75               SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
76               SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
77   caches:
78     sonar: ~/.sonar
79
80 clone:
81   depth: full
82
83 pipelines:
84   branches:
85     '{main}':
86       - step: *build-step
87
88   pull-requests:
89     '**':
90       - step: *build-step
91 "
92 `;
93
94 exports[`should follow and complete all steps: C++ (automatic) and other: bitbucket-pipelines.yml 1`] = `
95 "image: maven:3.3.9
96
97 definitions:
98   steps:
99     - step: &build-step
100         name: SonarQube analysis
101         script:
102           - pipe: sonarsource/sonarqube-scan:2.0.1
103             variables:
104               SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
105               SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
106   caches:
107     sonar: ~/.sonar
108
109 clone:
110   depth: full
111
112 pipelines:
113   branches:
114     '{main}':
115       - step: *build-step
116
117   pull-requests:
118     '**':
119       - step: *build-step
120 "
121 `;
122
123 exports[`should follow and complete all steps: C++ (automatic) and other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
124
125 exports[`should follow and complete all steps: C++ (automatic) and other: sonar-project.properties 2`] = `"sonar.projectKey=my-project"`;
126
127 exports[`should follow and complete all steps: C++ (manual arm64) and Objective-C: bitbucket-pipelines.yml 1`] = `
128 "image: <image ready for your build toolchain>
129
130 definitions:
131   steps:
132     - step: &build-step
133         name: Build the project, and run the SonarQube analysis
134         script:
135           - export SONAR_SCANNER_VERSION=6.1.0.4477
136           - mkdir $HOME/.sonar
137           - curl -sSLo $HOME/.sonar/build-wrapper-linux-aarch64.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-aarch64.zip
138           - unzip -o $HOME/.sonar/build-wrapper-linux-aarch64.zip -d $HOME/.sonar/
139           - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-aarch64.zip
140           - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
141           - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-aarch64/bin"
142           - <any step required before running your build, like ./configure>
143           - $HOME/.sonar/build-wrapper-linux-aarch64/build-wrapper-linux-aarch64 --out-dir bw-output <your clean build command>
144           - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json  
145   caches:
146     sonar: ~/.sonar
147
148 clone:
149   depth: full
150
151 pipelines:
152   branches:
153     '{main}':
154       - step: *build-step
155
156   pull-requests:
157     '**':
158       - step: *build-step"
159 `;
160
161 exports[`should follow and complete all steps: C++ (manual arm64) and Objective-C: bitbucket-pipelines.yml 2`] = `"sonar.projectKey=my-project"`;
162
163 exports[`should follow and complete all steps: C++ (manual arm64) and Objective-C: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
164
165 exports[`should follow and complete all steps: C++ (manual arm64) and Objective-C: sonar-project.properties 2`] = `
166 "image: <image ready for your build toolchain>
167
168 definitions:
169   steps:
170     - step: &build-step
171         name: Build the project, and run the SonarQube analysis
172         script:
173           - export SONAR_SCANNER_VERSION=6.1.0.4477
174           - mkdir $HOME/.sonar
175           - curl -sSLo $HOME/.sonar/build-wrapper-linux-aarch64.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-aarch64.zip
176           - unzip -o $HOME/.sonar/build-wrapper-linux-aarch64.zip -d $HOME/.sonar/
177           - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-aarch64.zip
178           - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
179           - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-aarch64/bin"
180           - <any step required before running your build, like ./configure>
181           - $HOME/.sonar/build-wrapper-linux-aarch64/build-wrapper-linux-aarch64 --out-dir bw-output <your clean build command>
182           - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json  
183   caches:
184     sonar: ~/.sonar
185
186 clone:
187   depth: full
188
189 pipelines:
190   branches:
191     '{main}':
192       - step: *build-step
193
194   pull-requests:
195     '**':
196       - step: *build-step"
197 `;
198
199 exports[`should follow and complete all steps: C++ (manual) and Objective-C: bitbucket-pipelines.yml 1`] = `
200 "image: <image ready for your build toolchain>
201
202 definitions:
203   steps:
204     - step: &build-step
205         name: Build the project, and run the SonarQube analysis
206         script:
207           - export SONAR_SCANNER_VERSION=6.1.0.4477
208           - mkdir $HOME/.sonar
209           - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
210           - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
211           - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-x64.zip
212           - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
213           - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-x64/bin"
214           - <any step required before running your build, like ./configure>
215           - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
216           - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json  
217   caches:
218     sonar: ~/.sonar
219
220 clone:
221   depth: full
222
223 pipelines:
224   branches:
225     '{main}':
226       - step: *build-step
227
228   pull-requests:
229     '**':
230       - step: *build-step"
231 `;
232
233 exports[`should follow and complete all steps: C++ (manual) and Objective-C: bitbucket-pipelines.yml 2`] = `"sonar.projectKey=my-project"`;
234
235 exports[`should follow and complete all steps: C++ (manual) and Objective-C: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
236
237 exports[`should follow and complete all steps: C++ (manual) and Objective-C: sonar-project.properties 2`] = `
238 "image: <image ready for your build toolchain>
239
240 definitions:
241   steps:
242     - step: &build-step
243         name: Build the project, and run the SonarQube analysis
244         script:
245           - export SONAR_SCANNER_VERSION=6.1.0.4477
246           - mkdir $HOME/.sonar
247           - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
248           - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
249           - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-x64.zip
250           - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
251           - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-x64/bin"
252           - <any step required before running your build, like ./configure>
253           - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
254           - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json  
255   caches:
256     sonar: ~/.sonar
257
258 clone:
259   depth: full
260
261 pipelines:
262   branches:
263     '{main}':
264       - step: *build-step
265
266   pull-requests:
267     '**':
268       - step: *build-step"
269 `;
270
271 exports[`should follow and complete all steps: Gradle: bitbucket-pipelines.yml 1`] = `
272 "image: eclipse-temurin:17
273
274 definitions:
275   steps:
276     - step: &build-step
277         name: SonarQube analysis
278         caches:
279           - gradle
280           - sonar
281         script:
282           - bash ./gradlew sonar
283   caches:
284     sonar: ~/.sonar
285
286 clone:
287   depth: full
288   
289 pipelines:
290   branches:
291     '{main}':
292       - step: *build-step
293
294   pull-requests:
295     '**':
296       - step: *build-step"
297 `;
298
299 exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
300 "plugins {
301   id "org.sonarqube" version "5.1.0.4882"
302 }
303
304 sonar {
305   properties {
306     property "sonar.projectKey", "my-project"
307     property "sonar.projectName", "MyProject"
308   }
309 }"
310 `;
311
312 exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
313 "plugins {
314   id("org.sonarqube") version "5.1.0.4882"
315 }
316     
317 sonar {
318   properties {
319     property("sonar.projectKey", "my-project")
320     property("sonar.projectName", "MyProject")
321   }
322 }"
323 `;
324
325 exports[`should follow and complete all steps: Maven: bitbucket-pipelines.yml 1`] = `
326 "image: maven:3-eclipse-temurin-17
327
328 definitions:
329   steps:
330     - step: &build-step
331         name: SonarQube analysis
332         caches:
333           - maven
334           - sonar
335         script:
336           - mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
337   caches:
338     sonar: ~/.sonar
339
340 clone:
341   depth: full
342   
343 pipelines:
344   branches:
345     '{main}':
346       - step: *build-step
347
348   pull-requests:
349     '**':
350       - step: *build-step"
351 `;
352
353 exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
354
355 exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
356
357 exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;