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