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