1 // Jest Snapshot v1, https://goo.gl/fbAQLP
3 exports[`should follow and complete all steps: .NET: gitlab-ci.yml 1`] = `
10 image: mcr.microsoft.com/dotnet/core/sdk:latest
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 openjdk-11-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\\""
34 stage: 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'
46 sast: gl-sast-sonar-report.json
52 exports[`should follow and complete all steps: Gradle: gitlab-ci.yml 1`] = `
55 - 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}"
76 stage: 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'
88 sast: gl-sast-sonar-report.json
94 exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
96 id "org.sonarqube" version "4.2.1.3168"
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 "4.2.1.3168"
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 - vulnerability-report
128 stage: sonarqube-check
129 image: maven:3.9.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
146 vulnerability-report:
147 stage: 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'
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 - vulnerability-report
179 stage: sonarqube-check
181 name: sonarsource/sonar-scanner-cli:latest
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}"
199 vulnerability-report:
200 stage: 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'
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"`;