You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GitLabCITutorial-it.tsx.snap 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`should follow and complete all steps: .NET: gitlab-ci.yml 1`] = `
  3. "stages:
  4. - sonarqube-check
  5. - sonarqube-vulnerability-report
  6. sonarqube-check:
  7. stage: sonarqube-check
  8. image: mcr.microsoft.com/dotnet/sdk:7.0
  9. variables:
  10. SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
  11. GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
  12. cache:
  13. key: "\${CI_JOB_NAME}"
  14. paths:
  15. - .sonar/cache
  16. script:
  17. - "apt-get update"
  18. - "apt-get install --yes --no-install-recommends openjdk-17-jre"
  19. - "dotnet tool install --global dotnet-sonarscanner"
  20. - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
  21. - "dotnet sonarscanner begin /k:\\"my-project\\" /d:sonar.token=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
  22. - "dotnet build"
  23. - "dotnet sonarscanner end /d:sonar.token=\\"$SONAR_TOKEN\\""
  24. allow_failure: true
  25. only:
  26. - merge_requests
  27. - master
  28. - main
  29. - develop
  30. sonarqube-vulnerability-report:
  31. stage: sonarqube-vulnerability-report
  32. script:
  33. - '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'
  34. allow_failure: true
  35. only:
  36. - merge_requests
  37. - master
  38. - main
  39. - develop
  40. artifacts:
  41. expire_in: 1 day
  42. reports:
  43. sast: gl-sast-sonar-report.json
  44. dependencies:
  45. - sonarqube-check
  46. "
  47. `;
  48. exports[`should follow and complete all steps: Gradle: gitlab-ci.yml 1`] = `
  49. "stages:
  50. - sonarqube-check
  51. - sonarqube-vulnerability-report
  52. sonarqube-check:
  53. stage: sonarqube-check
  54. image: gradle:8.2.0-jdk17-jammy
  55. variables:
  56. SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
  57. GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
  58. cache:
  59. key: "\${CI_JOB_NAME}"
  60. paths:
  61. - .sonar/cache
  62. script: gradle sonar
  63. allow_failure: true
  64. only:
  65. - merge_requests
  66. - master
  67. - main
  68. - develop
  69. sonarqube-vulnerability-report:
  70. stage: sonarqube-vulnerability-report
  71. script:
  72. - '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'
  73. allow_failure: true
  74. only:
  75. - merge_requests
  76. - master
  77. - main
  78. - develop
  79. artifacts:
  80. expire_in: 1 day
  81. reports:
  82. sast: gl-sast-sonar-report.json
  83. dependencies:
  84. - sonarqube-check
  85. "
  86. `;
  87. exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
  88. "plugins {
  89. id "org.sonarqube" version "5.0.0.4638"
  90. }
  91. sonar {
  92. properties {
  93. property "sonar.projectKey", "my-project"
  94. property "sonar.projectName", "MyProject"
  95. property "sonar.qualitygate.wait", true
  96. }
  97. }"
  98. `;
  99. exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
  100. "plugins {
  101. id ("org.sonarqube") version "5.0.0.4638"
  102. }
  103. sonar {
  104. properties {
  105. property("sonar.projectKey", "my-project")
  106. property("sonar.projectName", "MyProject")
  107. property("sonar.qualitygate.wait", true)
  108. }
  109. }"
  110. `;
  111. exports[`should follow and complete all steps: Maven: gitlab-ci.yml 1`] = `
  112. "stages:
  113. - sonarqube-check
  114. - sonarqube-vulnerability-report
  115. sonarqube-check:
  116. stage: sonarqube-check
  117. image: maven:3-eclipse-temurin-17
  118. variables:
  119. SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
  120. GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
  121. cache:
  122. key: "\${CI_JOB_NAME}"
  123. paths:
  124. - .sonar/cache
  125. script:
  126. - mvn verify sonar:sonar
  127. allow_failure: true
  128. only:
  129. - merge_requests
  130. - master
  131. - main
  132. - develop
  133. sonarqube-vulnerability-report:
  134. stage: sonarqube-vulnerability-report
  135. script:
  136. - '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'
  137. allow_failure: true
  138. only:
  139. - merge_requests
  140. - master
  141. - main
  142. - develop
  143. artifacts:
  144. expire_in: 1 day
  145. reports:
  146. sast: gl-sast-sonar-report.json
  147. dependencies:
  148. - sonarqube-check
  149. "
  150. `;
  151. exports[`should follow and complete all steps: Maven: pom.xml 1`] = `
  152. "<properties>
  153. <sonar.projectKey>my-project</sonar.projectKey>
  154. <sonar.projectName>MyProject</sonar.projectName>
  155. <sonar.qualitygate.wait>true</sonar.qualitygate.wait>
  156. </properties>"
  157. `;
  158. exports[`should follow and complete all steps: Other: gitlab-ci.yml 1`] = `
  159. "stages:
  160. - sonarqube-check
  161. - sonarqube-vulnerability-report
  162. sonarqube-check:
  163. stage: sonarqube-check
  164. image:
  165. name: sonarsource/sonar-scanner-cli:5.0
  166. entrypoint: [""]
  167. variables:
  168. SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
  169. GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
  170. cache:
  171. key: "\${CI_JOB_NAME}"
  172. paths:
  173. - .sonar/cache
  174. script:
  175. - sonar-scanner
  176. allow_failure: true
  177. only:
  178. - merge_requests
  179. - master
  180. - main
  181. - develop
  182. sonarqube-vulnerability-report:
  183. stage: sonarqube-vulnerability-report
  184. script:
  185. - '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'
  186. allow_failure: true
  187. only:
  188. - merge_requests
  189. - master
  190. - main
  191. - develop
  192. artifacts:
  193. expire_in: 1 day
  194. reports:
  195. sast: gl-sast-sonar-report.json
  196. dependencies:
  197. - sonarqube-check
  198. "
  199. `;
  200. exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `
  201. "sonar.projectKey=my-project
  202. sonar.qualitygate.wait=true
  203. "
  204. `;
  205. exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
  206. exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
  207. exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;