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