1 // Jest Snapshot v1, https://goo.gl/fbAQLP
3 exports[`should follow and complete all steps: .NET: gitlab-ci.yml 1`] = `
6 - sonarqube-vulnerability-report
10 image: mcr.microsoft.com/dotnet/sdk:7.0
12 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
13 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
15 key: "\${CI_JOB_NAME}"
20 - "apt-get install --yes --no-install-recommends openjdk-17-jre"
21 - "dotnet tool install --global dotnet-sonarscanner"
22 - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
23 - "dotnet sonarscanner begin /k:\\"my-project\\" /d:sonar.token=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
25 - "dotnet sonarscanner end /d:sonar.token=\\"$SONAR_TOKEN\\""
28 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
29 - if: $CI_COMMIT_BRANCH == 'master'
30 - if: $CI_COMMIT_BRANCH == 'main'
31 - if: $CI_COMMIT_BRANCH == 'develop'
33 sonarqube-vulnerability-report:
34 stage: sonarqube-vulnerability-report
36 - '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'
39 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
40 - if: $CI_COMMIT_BRANCH == 'master'
41 - if: $CI_COMMIT_BRANCH == 'main'
42 - if: $CI_COMMIT_BRANCH == 'develop'
46 sast: gl-sast-sonar-report.json
52 exports[`should follow and complete all steps: Gradle: gitlab-ci.yml 1`] = `
55 - sonarqube-vulnerability-report
58 stage: sonarqube-check
59 image: gradle:8.2.0-jdk17-jammy
61 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
62 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
64 key: "\${CI_JOB_NAME}"
70 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
71 - if: $CI_COMMIT_BRANCH == 'master'
72 - if: $CI_COMMIT_BRANCH == 'main'
73 - if: $CI_COMMIT_BRANCH == 'develop'
75 sonarqube-vulnerability-report:
76 stage: sonarqube-vulnerability-report
78 - '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'
81 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
82 - if: $CI_COMMIT_BRANCH == 'master'
83 - if: $CI_COMMIT_BRANCH == 'main'
84 - if: $CI_COMMIT_BRANCH == 'develop'
88 sast: gl-sast-sonar-report.json
94 exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
96 id "org.sonarqube" version "5.0.0.4638"
101 property "sonar.projectKey", "my-project"
102 property "sonar.projectName", "MyProject"
103 property "sonar.qualitygate.wait", true
108 exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
110 id ("org.sonarqube") version "5.0.0.4638"
115 property("sonar.projectKey", "my-project")
116 property("sonar.projectName", "MyProject")
117 property("sonar.qualitygate.wait", true)
122 exports[`should follow and complete all steps: Maven: gitlab-ci.yml 1`] = `
125 - sonarqube-vulnerability-report
128 stage: sonarqube-check
129 image: maven:3-eclipse-temurin-17
131 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
132 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
134 key: "\${CI_JOB_NAME}"
138 - mvn verify sonar:sonar
141 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
142 - if: $CI_COMMIT_BRANCH == 'master'
143 - if: $CI_COMMIT_BRANCH == 'main'
144 - if: $CI_COMMIT_BRANCH == 'develop'
146 sonarqube-vulnerability-report:
147 stage: sonarqube-vulnerability-report
149 - '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'
152 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
153 - if: $CI_COMMIT_BRANCH == 'master'
154 - if: $CI_COMMIT_BRANCH == 'main'
155 - if: $CI_COMMIT_BRANCH == 'develop'
159 sast: gl-sast-sonar-report.json
165 exports[`should follow and complete all steps: Maven: pom.xml 1`] = `
167 <sonar.projectKey>my-project</sonar.projectKey>
168 <sonar.projectName>MyProject</sonar.projectName>
169 <sonar.qualitygate.wait>true</sonar.qualitygate.wait>
173 exports[`should follow and complete all steps: Other: gitlab-ci.yml 1`] = `
176 - sonarqube-vulnerability-report
179 stage: sonarqube-check
181 name: sonarsource/sonar-scanner-cli:5.0
184 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
185 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
187 key: "\${CI_JOB_NAME}"
194 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
195 - if: $CI_COMMIT_BRANCH == 'master'
196 - if: $CI_COMMIT_BRANCH == 'main'
197 - if: $CI_COMMIT_BRANCH == 'develop'
199 sonarqube-vulnerability-report:
200 stage: sonarqube-vulnerability-report
202 - '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'
205 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
206 - if: $CI_COMMIT_BRANCH == 'master'
207 - if: $CI_COMMIT_BRANCH == 'main'
208 - if: $CI_COMMIT_BRANCH == 'develop'
212 sast: gl-sast-sonar-report.json
218 exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `
219 "sonar.projectKey=my-project
220 sonar.qualitygate.wait=true
224 exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
226 exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
228 exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;