]> source.dussan.org Git - sonarqube.git/blob
7384d2d1b4ece13b75aefd06e64c320d44792ffe
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render correctly for cfamily 1`] = `
4 <Fragment>
5   <PreambuleYaml
6     buildTool="cfamily"
7     component={
8       Object {
9         "breadcrumbs": Array [],
10         "key": "my-project",
11         "name": "MyProject",
12         "qualifier": "TRK",
13         "qualityGate": Object {
14           "isDefault": true,
15           "key": "30",
16           "name": "Sonar way",
17         },
18         "qualityProfiles": Array [
19           Object {
20             "deleted": false,
21             "key": "my-qp",
22             "language": "ts",
23             "name": "Sonar way",
24           },
25         ],
26         "tags": Array [],
27       }
28     }
29   />
30   <CreateYmlFile
31     yamlFileName="bitbucket-pipelines.yml"
32     yamlTemplate="image: <image ready for your build toolchain>
33
34 clone:
35   depth: full
36
37 pipelines:
38   branches:
39     '{master}': # or the name of your main branch
40       - step:
41           name: Download and install the build wrapper, build the project
42           script:
43             - mkdir $HOME/.sonar
44             - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
45             - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
46             - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
47             - pipe: sonarsource/sonarqube-scan:1.0.0
48               variables:
49                 EXTRA_ARGS: -Dsonar.cfamily.build-wrapper-output=bw-output
50                 SONAR_HOST_URL: \${SONAR_HOST_URL}
51                 SONAR_TOKEN: \${SONAR_TOKEN}
52
53 definitions:
54   caches:
55     sonar: ~/.sonar"
56   />
57   <CompilationInfo
58     className="abs-width-800"
59   />
60 </Fragment>
61 `;
62
63 exports[`should render correctly for cfamily: with branch enabled 1`] = `
64 <Fragment>
65   <PreambuleYaml
66     buildTool="cfamily"
67     component={
68       Object {
69         "breadcrumbs": Array [],
70         "key": "my-project",
71         "name": "MyProject",
72         "qualifier": "TRK",
73         "qualityGate": Object {
74           "isDefault": true,
75           "key": "30",
76           "name": "Sonar way",
77         },
78         "qualityProfiles": Array [
79           Object {
80             "deleted": false,
81             "key": "my-qp",
82             "language": "ts",
83             "name": "Sonar way",
84           },
85         ],
86         "tags": Array [],
87       }
88     }
89   />
90   <CreateYmlFile
91     yamlFileName="bitbucket-pipelines.yml"
92     yamlTemplate="image: <image ready for your build toolchain>
93
94 clone:
95   depth: full
96
97 pipelines:
98   branches:
99     '{master}': # or the name of your main branch
100       - step:
101           name: Download and install the build wrapper, build the project
102           script:
103             - mkdir $HOME/.sonar
104             - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
105             - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
106             - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
107             - pipe: sonarsource/sonarqube-scan:1.0.0
108               variables:
109                 EXTRA_ARGS: -Dsonar.cfamily.build-wrapper-output=bw-output
110                 SONAR_HOST_URL: \${SONAR_HOST_URL}
111                 SONAR_TOKEN: \${SONAR_TOKEN}
112
113   pull-requests:
114     '**':
115       - step:
116           name: Download and install the build wrapper, build the project
117           script:
118             - mkdir $HOME/.sonar
119             - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
120             - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
121             - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
122             - pipe: sonarsource/sonarqube-scan:1.0.0
123               variables:
124                 EXTRA_ARGS: -Dsonar.cfamily.build-wrapper-output=bw-output
125                 SONAR_HOST_URL: \${SONAR_HOST_URL}
126                 SONAR_TOKEN: \${SONAR_TOKEN}
127 definitions:
128   caches:
129     sonar: ~/.sonar"
130   />
131   <CompilationInfo
132     className="abs-width-800"
133   />
134 </Fragment>
135 `;
136
137 exports[`should render correctly for dotnet 1`] = `
138 <Fragment>
139   <PreambuleYaml
140     buildTool="dotnet"
141     component={
142       Object {
143         "breadcrumbs": Array [],
144         "key": "my-project",
145         "name": "MyProject",
146         "qualifier": "TRK",
147         "qualityGate": Object {
148           "isDefault": true,
149           "key": "30",
150           "name": "Sonar way",
151         },
152         "qualityProfiles": Array [
153           Object {
154             "deleted": false,
155             "key": "my-qp",
156             "language": "ts",
157             "name": "Sonar way",
158           },
159         ],
160         "tags": Array [],
161       }
162     }
163   />
164   <CreateYmlFile
165     yamlFileName="bitbucket-pipelines.yml"
166     yamlTemplate="image: mcr.microsoft.com/dotnet/core/sdk:latest
167    
168 pipelines:
169   branches:
170     '{master}': # or the name of your main branch
171       - step:
172           name: SonarQube analysis
173           caches:
174             - dotnetcore
175             - sonar
176           script:
177             - apt-get update
178             - apt-get install --yes openjdk-11-jre
179             - dotnet tool install --global dotnet-sonarscanner
180             - export PATH=\\"$PATH:/root/.dotnet/tools\\"
181             - dotnet sonarscanner begin /k:\\"my-project\\" /d:\\"sonar.login=\${SONAR_TOKEN}\\"  /d:\\"sonar.host.url=\${SONAR_HOST_URL}\\"
182             - dotnet build 
183             - dotnet sonarscanner end /d:\\"sonar.login=\${SONAR_TOKEN}\\"
184               
185 definitions:
186   caches:
187     sonar: ~/.sonar"
188   />
189 </Fragment>
190 `;
191
192 exports[`should render correctly for dotnet: with branch enabled 1`] = `
193 <Fragment>
194   <PreambuleYaml
195     buildTool="dotnet"
196     component={
197       Object {
198         "breadcrumbs": Array [],
199         "key": "my-project",
200         "name": "MyProject",
201         "qualifier": "TRK",
202         "qualityGate": Object {
203           "isDefault": true,
204           "key": "30",
205           "name": "Sonar way",
206         },
207         "qualityProfiles": Array [
208           Object {
209             "deleted": false,
210             "key": "my-qp",
211             "language": "ts",
212             "name": "Sonar way",
213           },
214         ],
215         "tags": Array [],
216       }
217     }
218   />
219   <CreateYmlFile
220     yamlFileName="bitbucket-pipelines.yml"
221     yamlTemplate="image: mcr.microsoft.com/dotnet/core/sdk:latest
222    
223 pipelines:
224   branches:
225     '{master}': # or the name of your main branch
226       - step:
227           name: SonarQube analysis
228           caches:
229             - dotnetcore
230             - sonar
231           script:
232             - apt-get update
233             - apt-get install --yes openjdk-11-jre
234             - dotnet tool install --global dotnet-sonarscanner
235             - export PATH=\\"$PATH:/root/.dotnet/tools\\"
236             - dotnet sonarscanner begin /k:\\"my-project\\" /d:\\"sonar.login=\${SONAR_TOKEN}\\"  /d:\\"sonar.host.url=\${SONAR_HOST_URL}\\"
237             - dotnet build 
238             - dotnet sonarscanner end /d:\\"sonar.login=\${SONAR_TOKEN}\\"
239             
240   pull-requests:
241     '**':
242       - step:
243           name: SonarQube analysis
244           caches:
245             - dotnetcore
246             - sonar
247           script:
248             - apt-get update
249             - apt-get install --yes openjdk-11-jre
250             - dotnet tool install --global dotnet-sonarscanner
251             - export PATH=\\"$PATH:/root/.dotnet/tools\\"
252             - dotnet sonarscanner begin /k:\\"my-project\\" /d:\\"sonar.login=\${SONAR_TOKEN}\\"  /d:\\"sonar.host.url=\${SONAR_HOST_URL}\\"
253             - dotnet build 
254             - dotnet sonarscanner end /d:\\"sonar.login=\${SONAR_TOKEN}\\"
255                   
256 definitions:
257   caches:
258     sonar: ~/.sonar"
259   />
260 </Fragment>
261 `;
262
263 exports[`should render correctly for gradle 1`] = `
264 <Fragment>
265   <PreambuleYaml
266     buildTool="gradle"
267     component={
268       Object {
269         "breadcrumbs": Array [],
270         "key": "my-project",
271         "name": "MyProject",
272         "qualifier": "TRK",
273         "qualityGate": Object {
274           "isDefault": true,
275           "key": "30",
276           "name": "Sonar way",
277         },
278         "qualityProfiles": Array [
279           Object {
280             "deleted": false,
281             "key": "my-qp",
282             "language": "ts",
283             "name": "Sonar way",
284           },
285         ],
286         "tags": Array [],
287       }
288     }
289   />
290   <CreateYmlFile
291     yamlFileName="bitbucket-pipelines.yml"
292     yamlTemplate="image: openjdk:8
293
294 clone:
295   depth: full
296   
297 pipelines:
298   branches:
299     '{master}': # or the name of your main branch
300       - step:
301           name: SonarQube analysis
302           caches:
303             - gradle
304             - sonar
305           script:
306             - bash ./gradlew sonarqube
307
308 definitions:
309   caches:
310     sonar: ~/.sonar"
311   />
312 </Fragment>
313 `;
314
315 exports[`should render correctly for gradle: with branch enabled 1`] = `
316 <Fragment>
317   <PreambuleYaml
318     buildTool="gradle"
319     component={
320       Object {
321         "breadcrumbs": Array [],
322         "key": "my-project",
323         "name": "MyProject",
324         "qualifier": "TRK",
325         "qualityGate": Object {
326           "isDefault": true,
327           "key": "30",
328           "name": "Sonar way",
329         },
330         "qualityProfiles": Array [
331           Object {
332             "deleted": false,
333             "key": "my-qp",
334             "language": "ts",
335             "name": "Sonar way",
336           },
337         ],
338         "tags": Array [],
339       }
340     }
341   />
342   <CreateYmlFile
343     yamlFileName="bitbucket-pipelines.yml"
344     yamlTemplate="image: openjdk:8
345
346 clone:
347   depth: full
348   
349 pipelines:
350   branches:
351     '{master}': # or the name of your main branch
352       - step:
353           name: SonarQube analysis
354           caches:
355             - gradle
356             - sonar
357           script:
358             - bash ./gradlew sonarqube
359
360   pull-requests:
361     '**':
362       - step:
363           name: SonarQube analysis
364           caches:
365             - gradle
366             - sonar
367           script:
368             - bash ./gradlew sonarqube
369
370 definitions:
371   caches:
372     sonar: ~/.sonar"
373   />
374 </Fragment>
375 `;
376
377 exports[`should render correctly for maven 1`] = `
378 <Fragment>
379   <PreambuleYaml
380     buildTool="maven"
381     component={
382       Object {
383         "breadcrumbs": Array [],
384         "key": "my-project",
385         "name": "MyProject",
386         "qualifier": "TRK",
387         "qualityGate": Object {
388           "isDefault": true,
389           "key": "30",
390           "name": "Sonar way",
391         },
392         "qualityProfiles": Array [
393           Object {
394             "deleted": false,
395             "key": "my-qp",
396             "language": "ts",
397             "name": "Sonar way",
398           },
399         ],
400         "tags": Array [],
401       }
402     }
403   />
404   <CreateYmlFile
405     yamlFileName="bitbucket-pipelines.yml"
406     yamlTemplate="image: maven:3-openjdk-11
407
408 clone:
409   depth: full
410   
411 pipelines:
412   branches:
413     '{master}': # or the name of your main branch
414       - step:
415           name: SonarQube analysis
416           caches:
417             - maven
418             - sonar
419           script:
420             - mvn verify sonar:sonar -Dsonar.projectKey=my-project
421   
422 definitions:
423   caches:
424     sonar: ~/.sonar"
425   />
426 </Fragment>
427 `;
428
429 exports[`should render correctly for maven: with branch enabled 1`] = `
430 <Fragment>
431   <PreambuleYaml
432     buildTool="maven"
433     component={
434       Object {
435         "breadcrumbs": Array [],
436         "key": "my-project",
437         "name": "MyProject",
438         "qualifier": "TRK",
439         "qualityGate": Object {
440           "isDefault": true,
441           "key": "30",
442           "name": "Sonar way",
443         },
444         "qualityProfiles": Array [
445           Object {
446             "deleted": false,
447             "key": "my-qp",
448             "language": "ts",
449             "name": "Sonar way",
450           },
451         ],
452         "tags": Array [],
453       }
454     }
455   />
456   <CreateYmlFile
457     yamlFileName="bitbucket-pipelines.yml"
458     yamlTemplate="image: maven:3-openjdk-11
459
460 clone:
461   depth: full
462   
463 pipelines:
464   branches:
465     '{master}': # or the name of your main branch
466       - step:
467           name: SonarQube analysis
468           caches:
469             - maven
470             - sonar
471           script:
472             - mvn verify sonar:sonar -Dsonar.projectKey=my-project
473
474   pull-requests:
475     '**':
476       - step:
477           name: SonarQube analysis
478           caches:
479             - maven
480             - sonar
481           script:
482             - mvn verify sonar:sonar -Dsonar.projectKey=my-project
483   
484 definitions:
485   caches:
486     sonar: ~/.sonar"
487   />
488 </Fragment>
489 `;
490
491 exports[`should render correctly for other 1`] = `
492 <Fragment>
493   <PreambuleYaml
494     buildTool="other"
495     component={
496       Object {
497         "breadcrumbs": Array [],
498         "key": "my-project",
499         "name": "MyProject",
500         "qualifier": "TRK",
501         "qualityGate": Object {
502           "isDefault": true,
503           "key": "30",
504           "name": "Sonar way",
505         },
506         "qualityProfiles": Array [
507           Object {
508             "deleted": false,
509             "key": "my-qp",
510             "language": "ts",
511             "name": "Sonar way",
512           },
513         ],
514         "tags": Array [],
515       }
516     }
517   />
518   <CreateYmlFile
519     yamlFileName="bitbucket-pipelines.yml"
520     yamlTemplate="image: maven:3.3.9
521
522 clone:
523   depth: full
524
525 pipelines:
526   branches:
527     '{master}': # or the name of your main branch
528       - step:
529           name: SonarQube analysis
530           script:
531             - pipe: sonarsource/sonarqube-scan:1.0.0
532               variables:
533                 SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
534                 SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
535   
536 definitions:
537   caches:
538     sonar: ~/.sonar"
539   />
540 </Fragment>
541 `;
542
543 exports[`should render correctly for other: with branch enabled 1`] = `
544 <Fragment>
545   <PreambuleYaml
546     buildTool="other"
547     component={
548       Object {
549         "breadcrumbs": Array [],
550         "key": "my-project",
551         "name": "MyProject",
552         "qualifier": "TRK",
553         "qualityGate": Object {
554           "isDefault": true,
555           "key": "30",
556           "name": "Sonar way",
557         },
558         "qualityProfiles": Array [
559           Object {
560             "deleted": false,
561             "key": "my-qp",
562             "language": "ts",
563             "name": "Sonar way",
564           },
565         ],
566         "tags": Array [],
567       }
568     }
569   />
570   <CreateYmlFile
571     yamlFileName="bitbucket-pipelines.yml"
572     yamlTemplate="image: maven:3.3.9
573
574 clone:
575   depth: full
576
577 pipelines:
578   branches:
579     '{master}': # or the name of your main branch
580       - step:
581           name: SonarQube analysis
582           script:
583             - pipe: sonarsource/sonarqube-scan:1.0.0
584               variables:
585                 SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
586                 SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
587
588   pull-requests:
589     '**':
590       - step:
591           name: SonarQube analysis
592           script:
593             - pipe: sonarsource/sonarqube-scan:1.0.0
594               variables:
595                 SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
596                 SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
597   
598 definitions:
599   caches:
600     sonar: ~/.sonar"
601   />
602 </Fragment>
603 `;