1 // Jest Snapshot v1, https://goo.gl/fbAQLP
3 exports[`should follow and complete all steps: .NET: gitlab-ci.yml 1`] = `
5 image: mcr.microsoft.com/dotnet/core/sdk:latest
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
10 key: "\${CI_JOB_NAME}"
15 - "apt-get install --yes openjdk-11-jre"
16 - "dotnet tool install --global dotnet-sonarscanner"
17 - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
18 - "dotnet sonarscanner begin /k:\\"my-project\\" /d:sonar.login=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
20 - "dotnet sonarscanner end /d:sonar.login=\\"$SONAR_TOKEN\\""
23 - if: $CI_COMMIT_BRANCH == 'main'
27 exports[`should follow and complete all steps: CFamily: gitlab-ci.yml 1`] = `
28 "image: <image ready for your build toolchain>
43 - curl -sSLo build-wrapper-linux-x86.zip $SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip
44 - unzip -o build-wrapper-linux-x86.zip -d .sonar
49 - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
54 - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
55 - unzip -o sonar-scanner.zip -d .sonar
56 - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
60 exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `
61 "sonar.projectKey=my-project
62 sonar.qualitygate.wait=true
66 exports[`should follow and complete all steps: Gradle: build.gradle 1`] = `
68 id "org.sonarqube" version "3.5.0.2730"
73 property "sonar.projectKey", "my-project"
74 property "sonar.projectName", "MyProject"
75 property "sonar.qualitygate.wait", true
80 exports[`should follow and complete all steps: Gradle: gitlab-ci.yml 1`] = `
82 image: gradle:jre11-slim
84 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
85 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
87 key: "\${CI_JOB_NAME}"
93 - if: $CI_COMMIT_BRANCH == 'main'
97 exports[`should follow and complete all steps: Maven: gitlab-ci.yml 1`] = `
99 image: maven:3.6.3-jdk-11
101 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
102 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
104 key: "\${CI_JOB_NAME}"
108 - mvn verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
111 - if: $CI_COMMIT_BRANCH == 'main'
115 exports[`should follow and complete all steps: Maven: pom.xml 1`] = `
117 <sonar.qualitygate.wait>true</sonar.qualitygate.wait>
121 exports[`should follow and complete all steps: Other: gitlab-ci.yml 1`] = `
124 name: sonarsource/sonar-scanner-cli:latest
127 SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
128 GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
130 key: "\${CI_JOB_NAME}"
137 - if: $CI_COMMIT_BRANCH == 'main'
141 exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `
142 "sonar.projectKey=my-project
143 sonar.qualitygate.wait=true
147 exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
149 exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
151 exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;