1 // Jest Snapshot v1, https://goo.gl/fbAQLP
3 exports[`should follow and complete all steps: .NET: gitlab-ci.yml 1`] = `
4 "image: mcr.microsoft.com/dotnet/sdk:7.0
7 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
8 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
12 - sonarqube-vulnerability-report
15 stage: sonarqube-check
21 key: "\${CI_COMMIT_SHORT_SHA}"
28 - "apt-get install --yes --no-install-recommends openjdk-17-jre"
29 - "dotnet tool install --global dotnet-sonarscanner"
30 - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
31 - "dotnet sonarscanner begin /k:\\"my-project\\" /d:sonar.token=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
33 - "dotnet sonarscanner end /d:sonar.token=\\"$SONAR_TOKEN\\""
36 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
37 - if: $CI_COMMIT_BRANCH == 'master'
38 - if: $CI_COMMIT_BRANCH == 'main'
39 - if: $CI_COMMIT_BRANCH == 'develop'
41 sonarqube-vulnerability-report:
42 stage: sonarqube-vulnerability-report
44 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
47 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
48 - if: $CI_COMMIT_BRANCH == 'master'
49 - if: $CI_COMMIT_BRANCH == 'main'
50 - if: $CI_COMMIT_BRANCH == 'develop'
54 sast: gl-sast-sonar-report.json
58 exports[`should follow and complete all steps: CPP - macos: gitlab-ci.yml 1`] = `
62 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
63 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
70 - sonarqube-vulnerability-report
76 key: "\${CI_COMMIT_SHORT_SHA}"
81 # Download sonar-scanner
82 - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-macosx.zip'
83 - unzip -o sonar-scanner.zip
84 - mv sonar-scanner-6.0.0.4432-macosx sonar-scanner
88 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
89 - if: $CI_COMMIT_BRANCH == 'master'
90 - if: $CI_COMMIT_BRANCH == 'main'
91 - if: $CI_COMMIT_BRANCH == 'develop'
96 # prepare the build tree
101 key: "\${CI_COMMIT_SHORT_SHA}"
107 stage: sonarqube-check
113 key: "\${CI_COMMIT_SHORT_SHA}"
118 script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
121 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
122 - if: $CI_COMMIT_BRANCH == 'master'
123 - if: $CI_COMMIT_BRANCH == 'main'
124 - if: $CI_COMMIT_BRANCH == 'develop'
126 sonarqube-vulnerability-report:
127 stage: sonarqube-vulnerability-report
129 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
132 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
133 - if: $CI_COMMIT_BRANCH == 'master'
134 - if: $CI_COMMIT_BRANCH == 'main'
135 - if: $CI_COMMIT_BRANCH == 'develop'
139 sast: gl-sast-sonar-report.json
143 exports[`should follow and complete all steps: CPP - macos: gitlab-ci.yml 2`] = `
147 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
148 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
149 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
155 - sonarqube-vulnerability-report
161 key: "\${CI_COMMIT_SHORT_SHA}"
166 # Download sonar-scanner
167 - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-macosx.zip'
168 - unzip -o sonar-scanner.zip
169 - mv sonar-scanner-6.0.0.4432-macosx sonar-scanner
170 # Download build-wrapper
171 - curl -sSLo ./build-wrapper-macosx-x86.zip "$SONAR_HOST_URL/static/cpp/build-wrapper-macosx-x86.zip"
172 - unzip -o build-wrapper-macosx-x86.zip
173 - mv build-wrapper-macosx-x86 build-wrapper
176 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
177 - if: $CI_COMMIT_BRANCH == 'master'
178 - if: $CI_COMMIT_BRANCH == 'main'
179 - if: $CI_COMMIT_BRANCH == 'develop'
184 # prepare the build tree
186 - build-wrapper/build-wrapper-macosx-x86 --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
189 key: "\${CI_COMMIT_SHORT_SHA}"
193 - "\${BUILD_WRAPPER_OUT_DIR}"
196 stage: sonarqube-check
202 key: "\${CI_COMMIT_SHORT_SHA}"
205 - "\${BUILD_WRAPPER_OUT_DIR}"
207 script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
210 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
211 - if: $CI_COMMIT_BRANCH == 'master'
212 - if: $CI_COMMIT_BRANCH == 'main'
213 - if: $CI_COMMIT_BRANCH == 'develop'
215 sonarqube-vulnerability-report:
216 stage: sonarqube-vulnerability-report
218 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
221 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
222 - if: $CI_COMMIT_BRANCH == 'master'
223 - if: $CI_COMMIT_BRANCH == 'main'
224 - if: $CI_COMMIT_BRANCH == 'develop'
228 sast: gl-sast-sonar-report.json
232 exports[`should follow and complete all steps: CPP - manual: gitlab-ci.yml 1`] = `
236 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
237 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
238 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
244 - sonarqube-vulnerability-report
250 key: "\${CI_COMMIT_SHORT_SHA}"
255 # Download sonar-scanner
256 - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-linux.zip'
257 - unzip -o sonar-scanner.zip
258 - mv sonar-scanner-6.0.0.4432-linux sonar-scanner
259 # Download build-wrapper
260 - curl -sSLo ./build-wrapper-linux-x86.zip "$SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip"
261 - unzip -o build-wrapper-linux-x86.zip
262 - mv build-wrapper-linux-x86 build-wrapper
265 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
266 - if: $CI_COMMIT_BRANCH == 'master'
267 - if: $CI_COMMIT_BRANCH == 'main'
268 - if: $CI_COMMIT_BRANCH == 'develop'
273 # prepare the build tree
275 - build-wrapper/build-wrapper-linux-x86-64 --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
278 key: "\${CI_COMMIT_SHORT_SHA}"
282 - "\${BUILD_WRAPPER_OUT_DIR}"
285 stage: sonarqube-check
291 key: "\${CI_COMMIT_SHORT_SHA}"
294 - "\${BUILD_WRAPPER_OUT_DIR}"
296 script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
299 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
300 - if: $CI_COMMIT_BRANCH == 'master'
301 - if: $CI_COMMIT_BRANCH == 'main'
302 - if: $CI_COMMIT_BRANCH == 'develop'
304 sonarqube-vulnerability-report:
305 stage: sonarqube-vulnerability-report
307 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
310 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
311 - if: $CI_COMMIT_BRANCH == 'master'
312 - if: $CI_COMMIT_BRANCH == 'main'
313 - if: $CI_COMMIT_BRANCH == 'develop'
317 sast: gl-sast-sonar-report.json
321 exports[`should follow and complete all steps: CPP - windows: gitlab-ci.yml 1`] = `
325 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
326 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
333 - sonarqube-vulnerability-report
339 key: "\${CI_COMMIT_SHORT_SHA}"
344 # Download sonar-scanner
345 - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-windows.zip'
346 - unzip -o sonar-scanner.zip
347 - mv sonar-scanner-6.0.0.4432-windows sonar-scanner
351 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
352 - if: $CI_COMMIT_BRANCH == 'master'
353 - if: $CI_COMMIT_BRANCH == 'main'
354 - if: $CI_COMMIT_BRANCH == 'develop'
359 # prepare the build tree
364 key: "\${CI_COMMIT_SHORT_SHA}"
370 stage: sonarqube-check
376 key: "\${CI_COMMIT_SHORT_SHA}"
381 script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
384 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
385 - if: $CI_COMMIT_BRANCH == 'master'
386 - if: $CI_COMMIT_BRANCH == 'main'
387 - if: $CI_COMMIT_BRANCH == 'develop'
389 sonarqube-vulnerability-report:
390 stage: sonarqube-vulnerability-report
392 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
395 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
396 - if: $CI_COMMIT_BRANCH == 'master'
397 - if: $CI_COMMIT_BRANCH == 'main'
398 - if: $CI_COMMIT_BRANCH == 'develop'
402 sast: gl-sast-sonar-report.json
406 exports[`should follow and complete all steps: CPP - windows: gitlab-ci.yml 2`] = `
410 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
411 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
412 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
418 - sonarqube-vulnerability-report
424 key: "\${CI_COMMIT_SHORT_SHA}"
429 # Download sonar-scanner
430 - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-windows.zip'
431 - unzip -o sonar-scanner.zip
432 - mv sonar-scanner-6.0.0.4432-windows sonar-scanner
433 # Download build-wrapper
434 - curl -sSLo ./build-wrapper-win-x86.zip "$SONAR_HOST_URL/static/cpp/build-wrapper-win-x86.zip"
435 - unzip -o build-wrapper-win-x86.zip
436 - mv build-wrapper-win-x86 build-wrapper
439 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
440 - if: $CI_COMMIT_BRANCH == 'master'
441 - if: $CI_COMMIT_BRANCH == 'main'
442 - if: $CI_COMMIT_BRANCH == 'develop'
447 # prepare the build tree
449 - build-wrapper/build-wrapper-win-x86-64.exe --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
452 key: "\${CI_COMMIT_SHORT_SHA}"
456 - "\${BUILD_WRAPPER_OUT_DIR}"
459 stage: sonarqube-check
465 key: "\${CI_COMMIT_SHORT_SHA}"
468 - "\${BUILD_WRAPPER_OUT_DIR}"
470 script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
473 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
474 - if: $CI_COMMIT_BRANCH == 'master'
475 - if: $CI_COMMIT_BRANCH == 'main'
476 - if: $CI_COMMIT_BRANCH == 'develop'
478 sonarqube-vulnerability-report:
479 stage: sonarqube-vulnerability-report
481 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
484 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
485 - if: $CI_COMMIT_BRANCH == 'master'
486 - if: $CI_COMMIT_BRANCH == 'main'
487 - if: $CI_COMMIT_BRANCH == 'develop'
491 sast: gl-sast-sonar-report.json
495 exports[`should follow and complete all steps: CPP: gitlab-ci.yml 1`] = `
499 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
500 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
507 - sonarqube-vulnerability-report
513 key: "\${CI_COMMIT_SHORT_SHA}"
518 # Download sonar-scanner
519 - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-linux.zip'
520 - unzip -o sonar-scanner.zip
521 - mv sonar-scanner-6.0.0.4432-linux sonar-scanner
525 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
526 - if: $CI_COMMIT_BRANCH == 'master'
527 - if: $CI_COMMIT_BRANCH == 'main'
528 - if: $CI_COMMIT_BRANCH == 'develop'
533 # prepare the build tree
538 key: "\${CI_COMMIT_SHORT_SHA}"
544 stage: sonarqube-check
550 key: "\${CI_COMMIT_SHORT_SHA}"
555 script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
558 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
559 - if: $CI_COMMIT_BRANCH == 'master'
560 - if: $CI_COMMIT_BRANCH == 'main'
561 - if: $CI_COMMIT_BRANCH == 'develop'
563 sonarqube-vulnerability-report:
564 stage: sonarqube-vulnerability-report
566 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
569 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
570 - if: $CI_COMMIT_BRANCH == 'master'
571 - if: $CI_COMMIT_BRANCH == 'main'
572 - if: $CI_COMMIT_BRANCH == 'develop'
576 sast: gl-sast-sonar-report.json
580 exports[`should follow and complete all steps: CPP: sonar-project.properties 1`] = `
581 "sonar.projectKey=my-project
582 sonar.qualitygate.wait=true
586 exports[`should follow and complete all steps: Gradle: gitlab-ci.yml 1`] = `
587 "image: gradle:8.2.0-jdk17-jammy
590 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
591 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
595 - sonarqube-vulnerability-report
598 stage: sonarqube-check
604 key: "\${CI_COMMIT_SHORT_SHA}"
612 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
613 - if: $CI_COMMIT_BRANCH == 'master'
614 - if: $CI_COMMIT_BRANCH == 'main'
615 - if: $CI_COMMIT_BRANCH == 'develop'
617 sonarqube-vulnerability-report:
618 stage: sonarqube-vulnerability-report
620 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
623 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
624 - if: $CI_COMMIT_BRANCH == 'master'
625 - if: $CI_COMMIT_BRANCH == 'main'
626 - if: $CI_COMMIT_BRANCH == 'develop'
630 sast: gl-sast-sonar-report.json
634 exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
636 id "org.sonarqube" version "5.0.0.4638"
641 property "sonar.projectKey", "my-project"
642 property "sonar.projectName", "MyProject"
643 property "sonar.qualitygate.wait", true
648 exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
650 id ("org.sonarqube") version "5.0.0.4638"
655 property("sonar.projectKey", "my-project")
656 property("sonar.projectName", "MyProject")
657 property("sonar.qualitygate.wait", true)
662 exports[`should follow and complete all steps: Maven: gitlab-ci.yml 1`] = `
663 "image: maven:3-eclipse-temurin-17
666 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
667 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
671 - sonarqube-vulnerability-report
674 stage: sonarqube-check
680 key: "\${CI_COMMIT_SHORT_SHA}"
686 - mvn verify sonar:sonar
689 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
690 - if: $CI_COMMIT_BRANCH == 'master'
691 - if: $CI_COMMIT_BRANCH == 'main'
692 - if: $CI_COMMIT_BRANCH == 'develop'
694 sonarqube-vulnerability-report:
695 stage: sonarqube-vulnerability-report
697 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
700 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
701 - if: $CI_COMMIT_BRANCH == 'master'
702 - if: $CI_COMMIT_BRANCH == 'main'
703 - if: $CI_COMMIT_BRANCH == 'develop'
707 sast: gl-sast-sonar-report.json
711 exports[`should follow and complete all steps: Maven: pom.xml 1`] = `
713 <sonar.projectKey>my-project</sonar.projectKey>
714 <sonar.projectName>MyProject</sonar.projectName>
715 <sonar.qualitygate.wait>true</sonar.qualitygate.wait>
719 exports[`should follow and complete all steps: Other: gitlab-ci.yml 1`] = `
721 name: sonarsource/sonar-scanner-cli:latest
725 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
726 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
730 - sonarqube-vulnerability-report
733 stage: sonarqube-check
739 key: "\${CI_COMMIT_SHORT_SHA}"
748 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
749 - if: $CI_COMMIT_BRANCH == 'master'
750 - if: $CI_COMMIT_BRANCH == 'main'
751 - if: $CI_COMMIT_BRANCH == 'develop'
753 sonarqube-vulnerability-report:
754 stage: sonarqube-vulnerability-report
756 - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
759 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
760 - if: $CI_COMMIT_BRANCH == 'master'
761 - if: $CI_COMMIT_BRANCH == 'main'
762 - if: $CI_COMMIT_BRANCH == 'develop'
766 sast: gl-sast-sonar-report.json
770 exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `
771 "sonar.projectKey=my-project
772 sonar.qualitygate.wait=true
776 exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
778 exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
780 exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;