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.

BitbucketPipelinesTutorial-it.tsx.snap 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`should follow and complete all steps: .NET: bitbucket-pipelines.yml 1`] = `
  3. "image: mcr.microsoft.com/dotnet/sdk:7.0
  4. definitions:
  5. steps:
  6. - step: &build-step
  7. name: SonarQube analysis
  8. caches:
  9. - dotnetcore
  10. - sonar
  11. script:
  12. - apt-get update
  13. - apt-get install --yes --no-install-recommends openjdk-17-jre
  14. - dotnet tool install --global dotnet-sonarscanner
  15. - export PATH="$PATH:/root/.dotnet/tools"
  16. - dotnet sonarscanner begin /k:"my-project" /d:"sonar.token=\${SONAR_TOKEN}" /d:"sonar.host.url=\${SONAR_HOST_URL}"
  17. - dotnet build
  18. - dotnet sonarscanner end /d:"sonar.token=\${SONAR_TOKEN}"
  19. caches:
  20. sonar: ~/.sonar
  21. pipelines:
  22. branches:
  23. '{main}':
  24. - step: *build-step
  25. pull-requests:
  26. '**':
  27. - step: *build-step"
  28. `;
  29. exports[`should follow and complete all steps: CFamily: bitbucket-pipelines.yml 1`] = `
  30. "image: <image ready for your build toolchain>
  31. definitions:
  32. steps:
  33. - step: &build-step
  34. name: Build the project, and run the SonarQube analysis
  35. script:
  36. - export SONAR_SCANNER_VERSION=5.0.1.3006
  37. - mkdir $HOME/.sonar
  38. - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
  39. - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
  40. - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip
  41. - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
  42. - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin"
  43. - <any step required before running your build, like ./configure>
  44. - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
  45. - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output
  46. caches:
  47. sonar: ~/.sonar
  48. clone:
  49. depth: full
  50. pipelines:
  51. branches:
  52. '{main}':
  53. - step: *build-step
  54. pull-requests:
  55. '**':
  56. - step: *build-step"
  57. `;
  58. exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
  59. exports[`should follow and complete all steps: Gradle: bitbucket-pipelines.yml 1`] = `
  60. "image: eclipse-temurin:17
  61. definitions:
  62. steps:
  63. - step: &build-step
  64. name: SonarQube analysis
  65. caches:
  66. - gradle
  67. - sonar
  68. script:
  69. - bash ./gradlew sonar
  70. caches:
  71. sonar: ~/.sonar
  72. clone:
  73. depth: full
  74. pipelines:
  75. branches:
  76. '{main}':
  77. - step: *build-step
  78. pull-requests:
  79. '**':
  80. - step: *build-step"
  81. `;
  82. exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
  83. "plugins {
  84. id "org.sonarqube" version "5.0.0.4638"
  85. }
  86. sonar {
  87. properties {
  88. property "sonar.projectKey", "my-project"
  89. property "sonar.projectName", "MyProject"
  90. }
  91. }"
  92. `;
  93. exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
  94. "plugins {
  95. id("org.sonarqube") version "5.0.0.4638"
  96. }
  97. sonar {
  98. properties {
  99. property("sonar.projectKey", "my-project")
  100. property("sonar.projectName", "MyProject")
  101. }
  102. }"
  103. `;
  104. exports[`should follow and complete all steps: Maven: bitbucket-pipelines.yml 1`] = `
  105. "image: maven:3-eclipse-temurin-17
  106. definitions:
  107. steps:
  108. - step: &build-step
  109. name: SonarQube analysis
  110. caches:
  111. - maven
  112. - sonar
  113. script:
  114. - mvn verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
  115. caches:
  116. sonar: ~/.sonar
  117. clone:
  118. depth: full
  119. pipelines:
  120. branches:
  121. '{main}':
  122. - step: *build-step
  123. pull-requests:
  124. '**':
  125. - step: *build-step"
  126. `;
  127. exports[`should follow and complete all steps: Other: .github/workflows/build.yml 1`] = `
  128. "image: maven:3.3.9
  129. definitions:
  130. steps:
  131. - step: &build-step
  132. name: SonarQube analysis
  133. script:
  134. - pipe: sonarsource/sonarqube-scan:2.0.1
  135. variables:
  136. SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
  137. SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
  138. caches:
  139. sonar: ~/.sonar
  140. clone:
  141. depth: full
  142. pipelines:
  143. branches:
  144. '{main}':
  145. - step: *build-step
  146. pull-requests:
  147. '**':
  148. - step: *build-step
  149. "
  150. `;
  151. exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
  152. exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
  153. exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
  154. exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;