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.

.cirrus.yml 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. # content of service-account-credentials.json, used to access to Google Cloud Platform
  2. gcp_credentials: ENCRYPTED[!e5f7207bd8d02d383733bef47e18296ac32e3b7d22eb480354e8dd8fdc0004be45a8a4e72c797bd66ee94eb3340fa363!]
  3. env:
  4. GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+PrintFlagsFinal -XshowSettings:vm -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF8 -Duser.language=en -Duser.country=US"
  5. # to be replaced by other credentials
  6. ARTIFACTORY_PRIVATE_USERNAME: repox-private-reader
  7. ARTIFACTORY_PRIVATE_PASSWORD: ENCRYPTED[!35ca4446564213d4fd2d1a96e42a871d5de6e6aac4e1dd3e89342892a60a2badf74a966bcc8e885e9c9d09a775ffe4c0!]
  8. ARTIFACTORY_DEPLOY_USERNAME: repox-qa-deployer
  9. ARTIFACTORY_DEPLOY_PASSWORD: ENCRYPTED[!d484e19f33c9ce63b165f70e414a33b1ac6c215a126791aacbf8059626caf0fd8a78e999a20af5c1a4ba01c0b0247921!]
  10. ARTIFACTORY_API_KEY: ENCRYPTED[60f92cec4bf8446867dce41fe8dc77457f10065b82a24bfa3924d496aa1c14b89b531b86c3a34274abb12cf9a4cb36c4]
  11. # download licenses for testing commercial editions
  12. GITHUB_TOKEN: ENCRYPTED[!f272985ea5b49b3cf9c414b98de6a8e9096be47bfcee52f33311ba3131a2af637c1b956f49585b7757dd84b7c030233a!]
  13. # use a permanent GitHub access token to perform a clone (by default CirrusCI uses a temporary one)
  14. CIRRUS_REPO_CLONE_TOKEN: ENCRYPTED[f20fee6519296187a473964e60afb08a1bbdc889a624fad0297b41a21d8697f8d2da4d2d245194ade630dcf46b4b581e]
  15. # notifications to burgr
  16. BURGR_URL: ENCRYPTED[24fba83587c1e9ed372b6cfdf12e4739ebe3b6e5b5082f1a2a742e840dd2e4b61fd5e281bf2632b22b3ad346c650c05c]
  17. BURGR_USERNAME: ENCRYPTED[cf7bfb936025fb763013bbfef0ab5723c0d9b53f135d79af36f9defa933f4b5fc72842bd83a97ce9b614503c1b77e6da]
  18. BURGR_PASSWORD: ENCRYPTED[bc554fc6a06c9f14cc9924cefad0a69e962a905b6d1609fc9357d458b45fc52ac74c960ad9c7382a0691433fa9dcd483]
  19. # analysis on next.sonarqube.com
  20. SONARQUBE_NEXT_TOKEN: ENCRYPTED[!0d599f9fb1613db33388821ca04af23f090729902b4421ad0a53cea8393d1e9039f2e47d65a246781b0e2c3718c172a1!]
  21. # to trigger docs deployment
  22. BUDDY_WORKS_TOKEN: ENCRYPTED[9ba648f3167b6f0c0befbba2f816bfffd53260fef06fb0fe8bba0a19ae4808c8b1567c5dcee2a2ee5299a5969058f495]
  23. ELASTIC_PWD: ENCRYPTED[78c127034b9f06bc1b5ad7a520de2da094f3eaf1dcb35f12b0f178fa90ce2fd157bd6f9feece9bf3a54b4e3805bc39fb]
  24. CIRRUS_LOG_TIMESTAMP: true
  25. auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'branch.*' && $CIRRUS_BRANCH != 'dogfood-on-next'
  26. only_nightly_depending_on_build_template: &ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  27. depends_on: build
  28. # Comment the following line and commit with message "DO NOT MERGE" in order to run
  29. # this task on your branch
  30. only_if: $CIRRUS_BRANCH == "branch-nightly-build"
  31. only_upon_sql_changes_or_nightly_depending_on_build_template: &ONLY_UPON_SQL_CHANGE_OR_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  32. depends_on: build
  33. only_if: >-
  34. $CIRRUS_BRANCH == "branch-nightly-build" ||
  35. changesInclude('server/sonar-db-dao/**/*Mapper.xml', 'server/sonar-db-migration/**/DbVersion*.java')
  36. only_default_depending_on_build_template: &ONLY_DEFAULT_DEPENDING_ON_BUILD_TEMPLATE
  37. depends_on: build
  38. only_if: >-
  39. $CIRRUS_BRANCH !=~ "dogfood/.*" &&
  40. $CIRRUS_BRANCH != "public_master" &&
  41. $CIRRUS_CRON == ""
  42. docker_build_container_template: &GKE_CONTAINER_TEMPLATE
  43. dockerfile: private/docker/Dockerfile-build
  44. builder_image_project: sonarqube-team
  45. builder_image_name: docker-builder-v20200915
  46. cluster_name: cirrus-ci-cluster
  47. zone: us-central1-a
  48. namespace: default
  49. cpu: 1
  50. memory: 1Gb
  51. oracle_additional_container_template: &ORACLE_ADDITIONAL_CONTAINER_TEMPLATE
  52. name: oracle
  53. image: us.gcr.io/sonarqube-team/oracle12:0.0.1 # see https://github.com/SonarSource/vms/blob/master/docker/README.md#oracle-12c to build it
  54. port: 1521
  55. cpu: 2
  56. memory: 5Gb
  57. env:
  58. ORACLE_PWD: sonarqube
  59. postgres_additional_container_template: &POSTGRES_ADDITIONAL_CONTAINER_TEMPLATE
  60. name: postgres
  61. image: postgres:13.2
  62. port: 5432
  63. cpu: 1
  64. memory: 1Gb
  65. env:
  66. POSTGRES_USER: postgres
  67. POSTGRES_PASSWORD: postgres
  68. reports_junit_on_failure_template: &REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  69. jest_junit_cleanup_script: >
  70. find . -type f -wholename "**/build/test-results/test-jest/junit.xml" -exec
  71. xmlstarlet edit --inplace --delete '//testsuite[@errors=0 and @failures=0]' {} \;
  72. reports_artifacts:
  73. path: "**/build/reports/**/*"
  74. junit_artifacts:
  75. path: "**/build/test-results/**/*.xml"
  76. format: junit
  77. screenshots_on_failure_template: &REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  78. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  79. screenshots_artifacts:
  80. path: "**/build/screenshots/**/*"
  81. yarn_cache_template: &YARN_CACHE_TEMPLATE
  82. yarn_cache:
  83. folder: "~/.yarn/berry/cache"
  84. fingerprint_script: |
  85. cat \
  86. server/sonar-web/yarn.lock \
  87. server/sonar-docs/yarn.lock \
  88. private/core-extension-governance/yarn.lock \
  89. private/core-extension-license/yarn.lock \
  90. private/core-extension-securityreport/yarn.lock
  91. custom_clone_script_template: &CUSTOM_CLONE_SCRIPT_TEMPLATE
  92. clone_script: |
  93. git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR --depth=1
  94. git fetch origin $CIRRUS_CHANGE_IN_REPO --depth=1
  95. git reset --hard $CIRRUS_CHANGE_IN_REPO
  96. profile_artifacts_template: &PROFILE_ARTIFACTS_TEMPLATE
  97. profile_artifacts:
  98. path: "**/build/reports/profile/**/*"
  99. build_task:
  100. <<: *YARN_CACHE_TEMPLATE
  101. only_if: >-
  102. $CIRRUS_BRANCH !=~ "dogfood/.*" &&
  103. $CIRRUS_BRANCH != "public_master" &&
  104. $CIRRUS_CRON == ""
  105. timeout_in: 90m
  106. gke_container:
  107. <<: *GKE_CONTAINER_TEMPLATE
  108. cpu: 7.5
  109. memory: 8Gb
  110. env:
  111. # No need to clone the full history.
  112. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  113. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  114. CIRRUS_CLONE_DEPTH: 50
  115. ORG_GRADLE_PROJECT_signingKey: ENCRYPTED[!cc216dfe592f79db8006f2a591f8f98b40aa2b078e92025623594976fd32f6864c1e6b6ba74b50647f608e2418e6c336!]
  116. ORG_GRADLE_PROJECT_signingPassword: ENCRYPTED[!314a8fc344f45e462dd5e8dccd741d7562283a825e78ebca27d4ae9db8e65ce618e7f6aece386b2782a5abe5171467bd!]
  117. ORG_GRADLE_PROJECT_signingKeyId: 0x7DCD4258
  118. elasticsearch_distribution_cache:
  119. folder: sonar-application/build/elasticsearch-**.tar.gz
  120. script:
  121. - ./private/cirrus/cirrus-build.sh
  122. on_failure:
  123. reports_artifacts:
  124. path: "**/build/reports/**/*"
  125. always:
  126. <<: *PROFILE_ARTIFACTS_TEMPLATE
  127. validate_task:
  128. <<: *ONLY_DEFAULT_DEPENDING_ON_BUILD_TEMPLATE
  129. <<: *YARN_CACHE_TEMPLATE
  130. timeout_in: 90m
  131. gke_container:
  132. <<: *GKE_CONTAINER_TEMPLATE
  133. cpu: 6.5
  134. memory: 28Gb
  135. additional_containers:
  136. - <<: *POSTGRES_ADDITIONAL_CONTAINER_TEMPLATE
  137. script:
  138. - ./private/cirrus/cirrus-validate.sh postgres106
  139. on_failure:
  140. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  141. always:
  142. <<: *PROFILE_ARTIFACTS_TEMPLATE
  143. yarn_check-ci_task:
  144. <<: *ONLY_DEFAULT_DEPENDING_ON_BUILD_TEMPLATE
  145. <<: *YARN_CACHE_TEMPLATE
  146. timeout_in: 90m
  147. gke_container:
  148. <<: *GKE_CONTAINER_TEMPLATE
  149. cpu: 4
  150. memory: 8Gb
  151. script: |
  152. ./private/cirrus/cirrus-env.sh YARN
  153. gradle yarn_check-ci --profile
  154. on_failure:
  155. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  156. always:
  157. <<: *PROFILE_ARTIFACTS_TEMPLATE
  158. qa_task:
  159. <<: *ONLY_DEFAULT_DEPENDING_ON_BUILD_TEMPLATE
  160. gke_container:
  161. <<: *GKE_CONTAINER_TEMPLATE
  162. cpu: 3
  163. memory: 7Gb
  164. additional_containers:
  165. - <<: *POSTGRES_ADDITIONAL_CONTAINER_TEMPLATE
  166. env:
  167. # No need to clone the full history.
  168. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  169. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  170. CIRRUS_CLONE_DEPTH: 50
  171. matrix:
  172. - QA_CATEGORY: Cat1
  173. - QA_CATEGORY: Cat2
  174. - QA_CATEGORY: Cat3
  175. - QA_CATEGORY: Cat4
  176. - QA_CATEGORY: Cat5
  177. - QA_CATEGORY: Cat6
  178. - QA_CATEGORY: Cat7
  179. - QA_CATEGORY: Authentication
  180. - QA_CATEGORY: Gov
  181. - QA_CATEGORY: Dev
  182. - QA_CATEGORY: License
  183. - QA_CATEGORY: Branch
  184. - QA_CATEGORY: Upgrade
  185. script:
  186. - ./private/cirrus/cirrus-qa.sh postgres106
  187. on_failure:
  188. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  189. task: #bitbucket
  190. <<: *ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  191. gke_container:
  192. <<: *GKE_CONTAINER_TEMPLATE
  193. cpu: 3
  194. memory: 7Gb
  195. additional_containers:
  196. - <<: *POSTGRES_ADDITIONAL_CONTAINER_TEMPLATE
  197. maven_cache:
  198. folder: ~/.m2
  199. env:
  200. # No need to clone the full history.
  201. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  202. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  203. CIRRUS_CLONE_DEPTH: 50
  204. QA_CATEGORY: BITBUCKET
  205. matrix:
  206. - name: qa_bitbucket_5.15.0
  207. bitbucket_background_script: ./private/cirrus/cirrus-start-bitbucket.sh 5.15.0
  208. - name: qa_bitbucket_latest
  209. bitbucket_background_script: ./private/cirrus/cirrus-start-bitbucket.sh LATEST
  210. wait_for_bitbucket_to_boot_script: secs=3600; endTime=$(( $(date +%s) + secs )); while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:7990/bitbucket/status)" != "200" ]] || [ $(date +%s) -gt $endTime ]; do sleep 5; done
  211. script:
  212. - ./private/cirrus/cirrus-qa.sh postgres106
  213. on_failure:
  214. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  215. qa_bb_cloud_task:
  216. <<: *ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  217. gke_container:
  218. <<: *GKE_CONTAINER_TEMPLATE
  219. cpu: 2.4
  220. memory: 5Gb
  221. env:
  222. # No need to clone the full history.
  223. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  224. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  225. CIRRUS_CLONE_DEPTH: 50
  226. QA_CATEGORY: BITBUCKET_CLOUD
  227. BBC_CLIENT_ID: ENCRYPTED[f1c2c57d5f02885345b3db5776a3b28f5dbcc89723809f73ad05ada903ece9584f1dfe61b026c10eabd72c75d1258bac]
  228. BBC_CLIENT_SECRET: ENCRYPTED[39cc89ce4695c243fd688e687879bd473a60882fd30ba8613d6697e5d2b04e2017c68cae3a9a7ed9704f69c52bf229ee]
  229. BBC_READ_REPOS_APP_PASSWORD: ENCRYPTED[d33b02d02987e188b5cec2a14f6ddd04d1fcac39ed5d6ced08891fc562ebb6721c9fbf307c0eba81df78c83f75b3c27c]
  230. BBC_USERNAME: ENCRYPTED[f0af9be9d2fbaa55fbf69e4fce706ebc9131e0dc22cf8bce5d7ab2e0c2b57aff3ddbf6b3b77166e803a6000276256cea]
  231. gradle_cache:
  232. folder: ~/.gradle/caches
  233. script:
  234. - ./private/cirrus/cirrus-qa.sh h2
  235. cleanup_before_cache_script:
  236. - ./private/cirrus/cleanup-gradle-cache.sh
  237. on_failure:
  238. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  239. qa_ha_task:
  240. <<: *ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  241. gke_container:
  242. <<: *GKE_CONTAINER_TEMPLATE
  243. cpu: 2.4
  244. memory: 10Gb
  245. additional_containers:
  246. - <<: *POSTGRES_ADDITIONAL_CONTAINER_TEMPLATE
  247. env:
  248. # No need to clone the full history.
  249. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  250. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  251. CIRRUS_CLONE_DEPTH: 50
  252. QA_CATEGORY: HA
  253. gradle_cache:
  254. folder: ~/.gradle/caches
  255. script:
  256. - ./private/cirrus/cirrus-qa.sh postgres106
  257. cleanup_before_cache_script:
  258. - ./private/cirrus/cleanup-gradle-cache.sh
  259. on_failure:
  260. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  261. docker_gitlab_container_build_task:
  262. only_if: $CIRRUS_BRANCH == "branch-nightly-build"
  263. gce_instance:
  264. image_project: sonarqube-team
  265. image_family: docker-builder
  266. zone: us-central1-a
  267. preemptible: true
  268. disk: 10
  269. cpu: 4
  270. memory: 8G
  271. env:
  272. CIRRUS_CLONE_DEPTH: 3
  273. matrix:
  274. - GITLAB_TAG: latest
  275. - GITLAB_TAG: 11.7.0-ce.0
  276. build_script:
  277. - docker pull "us.gcr.io/sonarqube-team/sq-gitlab:${GITLAB_TAG}" || true
  278. - docker build --build-arg "GITLAB_TAG=${GITLAB_TAG}" --cache-from "us.gcr.io/sonarqube-team/sq-gitlab:${GITLAB_TAG}" -t "us.gcr.io/sonarqube-team/sq-gitlab:${GITLAB_TAG}" private/docker/gitlab/
  279. - docker push "us.gcr.io/sonarqube-team/sq-gitlab:${GITLAB_TAG}"
  280. # GitLab QA is executed in a dedicated task in order to not slow down the pipeline, as a GitLab on-prem server docker image is required.
  281. qa_gitlab_task:
  282. <<: *ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  283. depends_on:
  284. - build
  285. - docker_gitlab_container_build
  286. gke_container:
  287. <<: *GKE_CONTAINER_TEMPLATE
  288. cpu: 2.4
  289. memory: 5Gb
  290. use_in_memory_disk: true
  291. additional_containers:
  292. - name: gitlab
  293. ports:
  294. - 80
  295. - 443
  296. cpu: 2
  297. memory: 5Gb
  298. matrix:
  299. - image: us.gcr.io/sonarqube-team/sq-gitlab:latest
  300. - image: us.gcr.io/sonarqube-team/sq-gitlab:11.7.0-ce.0
  301. env:
  302. # No need to clone the full history.
  303. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  304. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  305. CIRRUS_CLONE_DEPTH: 50
  306. QA_CATEGORY: GITLAB
  307. gradle_cache:
  308. folder: ~/.gradle/caches
  309. script:
  310. - ./private/cirrus/cirrus-qa.sh h2
  311. cleanup_before_cache_script:
  312. - ./private/cirrus/cleanup-gradle-cache.sh
  313. on_failure:
  314. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  315. # Azure QA is executed in a dedicated task in order to not slow down the pipeline.
  316. qa_azure_task:
  317. <<: *ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  318. gke_container:
  319. <<: *GKE_CONTAINER_TEMPLATE
  320. cpu: 2.4
  321. memory: 5Gb
  322. env:
  323. # No need to clone the full history.
  324. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  325. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  326. CIRRUS_CLONE_DEPTH: 50
  327. QA_CATEGORY: AZURE
  328. AZURE_USERNAME_LOGIN: ENCRYPTED[dcdf19769c1501408ebc22670c76d5e375cd739de2df5dfa3f215aa795296dfb257dbbcbe9bdfd33135feb04421fea1f]
  329. AZURE_CODE_READ_AND_WRITE_TOKEN: ENCRYPTED[eddc3448b40e72310f24f21241bdc1243860139d1a5aad593b016baedf03e4bba3f9e3d8d9f6329fe3b587966a8112d2]
  330. AZURE_FULL_ACCESS_TOKEN: ENCRYPTED[58779d6588e2e10d1b6f98fcc58a46957f8ef3a18e29d79abc6aa8d69ea55c23d8708e1f1af626464d309b1c7c087985]
  331. gradle_cache:
  332. folder: ~/.gradle/caches
  333. script:
  334. - ./private/cirrus/cirrus-qa.sh h2
  335. cleanup_before_cache_script:
  336. - ./private/cirrus/cleanup-gradle-cache.sh
  337. on_failure:
  338. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  339. # SAML QA is executed in a dedicated task in order to not slow down the pipeline, as a Keycloak server docker image is required.
  340. qa_saml_task:
  341. <<: *ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  342. gke_container:
  343. <<: *GKE_CONTAINER_TEMPLATE
  344. cpu: 2.4
  345. memory: 10Gb
  346. additional_containers:
  347. - name: keycloak
  348. image: jboss/keycloak:7.0.0
  349. port: 8080
  350. cpu: 1
  351. memory: 1Gb
  352. env:
  353. KEYCLOAK_USER: admin
  354. KEYCLOAK_PASSWORD: admin
  355. env:
  356. # No need to clone the full history.
  357. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  358. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  359. CIRRUS_CLONE_DEPTH: 50
  360. QA_CATEGORY: SAML
  361. gradle_cache:
  362. folder: ~/.gradle/caches
  363. script:
  364. - ./private/cirrus/cirrus-qa.sh h2
  365. cleanup_before_cache_script:
  366. - ./private/cirrus/cleanup-gradle-cache.sh
  367. on_failure:
  368. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  369. # LDAP QA is executed in a dedicated task in order to not slow down the pipeline, as a LDAP server and SonarQube server are re-started on each test.
  370. qa_ldap_task:
  371. <<: *ONLY_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  372. gke_container:
  373. <<: *GKE_CONTAINER_TEMPLATE
  374. cpu: 2.4
  375. memory: 10Gb
  376. env:
  377. # No need to clone the full history.
  378. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  379. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  380. CIRRUS_CLONE_DEPTH: 50
  381. QA_CATEGORY: LDAP
  382. gradle_cache:
  383. folder: ~/.gradle/caches
  384. script:
  385. - ./private/cirrus/cirrus-qa.sh h2
  386. cleanup_before_cache_script:
  387. - ./private/cirrus/cleanup-gradle-cache.sh
  388. on_failure:
  389. <<: *REPORTS_JUNIT_SCREENSHOTS_ON_FAILURE_TEMPLATE
  390. promote_task:
  391. <<: *ONLY_DEFAULT_DEPENDING_ON_BUILD_TEMPLATE
  392. depends_on:
  393. - build
  394. - validate
  395. - qa
  396. - qa_saml
  397. - qa_ldap
  398. gke_container:
  399. <<: *GKE_CONTAINER_TEMPLATE
  400. stateful: true
  401. env:
  402. # No need to clone the full history.
  403. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  404. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  405. CIRRUS_CLONE_DEPTH: 50
  406. script:
  407. - ./private/cirrus/cirrus-promote.sh
  408. deploy_docs_task:
  409. depends_on: promote
  410. skip: true
  411. only_if: $CIRRUS_BRANCH == 'dogfood-on-next'
  412. gke_container:
  413. <<: *GKE_CONTAINER_TEMPLATE
  414. env:
  415. # No need to clone the full history.
  416. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  417. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  418. CIRRUS_CLONE_DEPTH: 50
  419. script:
  420. - ./private/cirrus/cirrus-trigger-deploy-docs.sh
  421. package_docker_task:
  422. depends_on: promote
  423. only_if: $CIRRUS_BRANCH == 'dogfood-on-next'
  424. gce_instance:
  425. image_project: sonarqube-team
  426. image_family: docker-builder
  427. zone: us-central1-a
  428. disk: 10
  429. cpu: 4
  430. memory: 8G
  431. <<: *CUSTOM_CLONE_SCRIPT_TEMPLATE
  432. install_tooling_script:
  433. - ./private/cirrus/cirrus-tooling-for-package-docker.sh
  434. package_script:
  435. - ./private/cirrus/cirrus-package-docker.sh
  436. sql_mssql2017_task:
  437. <<: *ONLY_UPON_SQL_CHANGE_OR_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  438. gke_container:
  439. <<: *GKE_CONTAINER_TEMPLATE
  440. memory: 5Gb
  441. additional_containers:
  442. - name: mssql
  443. image: mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
  444. port: 1433
  445. cpu: 2
  446. memory: 5Gb
  447. env:
  448. MSSQL_PID: Developer # this is the default edition
  449. ACCEPT_EULA: Y
  450. SA_PASSWORD: sonarqube!1
  451. script:
  452. - ./private/cirrus/cirrus-db-unit-test.sh mssql2017
  453. on_failure:
  454. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  455. # this is the oldest compatible version of PostgreSQL
  456. sql_postgres96_task:
  457. <<: *ONLY_UPON_SQL_CHANGE_OR_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  458. gke_container:
  459. <<: *GKE_CONTAINER_TEMPLATE
  460. memory: 5Gb
  461. additional_containers:
  462. - <<: *POSTGRES_ADDITIONAL_CONTAINER_TEMPLATE
  463. image: postgres:9.6
  464. script:
  465. - ./private/cirrus/cirrus-db-unit-test.sh postgres96
  466. on_failure:
  467. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  468. sql_oracle12_task:
  469. <<: *ONLY_UPON_SQL_CHANGE_OR_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  470. gke_container:
  471. <<: *GKE_CONTAINER_TEMPLATE
  472. memory: 5Gb
  473. additional_containers:
  474. - <<: *ORACLE_ADDITIONAL_CONTAINER_TEMPLATE
  475. script:
  476. - ./private/cirrus/cirrus-db-unit-test.sh oracle12
  477. on_failure:
  478. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  479. upgd_mssql2019_task:
  480. <<: *ONLY_UPON_SQL_CHANGE_OR_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  481. gke_container:
  482. <<: *GKE_CONTAINER_TEMPLATE
  483. cpu: 1.5
  484. memory: 6Gb
  485. additional_containers:
  486. - name: mssql
  487. image: mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
  488. port: 1433
  489. cpu: 2
  490. memory: 5Gb
  491. env:
  492. MSSQL_PID: Developer # this is the default edition
  493. ACCEPT_EULA: Y
  494. SA_PASSWORD: sonarqube!1
  495. env:
  496. # No need to clone the full history.
  497. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  498. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  499. CIRRUS_CLONE_DEPTH: 50
  500. matrix:
  501. QA_CATEGORY: Upgrade
  502. script:
  503. - ./private/cirrus/cirrus-qa.sh mssql2017
  504. on_failure:
  505. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  506. upgd_oracle12_task:
  507. <<: *ONLY_UPON_SQL_CHANGE_OR_NIGHTLY_DEPENDING_ON_BUILD_TEMPLATE
  508. gke_container:
  509. <<: *GKE_CONTAINER_TEMPLATE
  510. cpu: 1.5
  511. memory: 6Gb
  512. additional_containers:
  513. - <<: *ORACLE_ADDITIONAL_CONTAINER_TEMPLATE
  514. env:
  515. # No need to clone the full history.
  516. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  517. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  518. CIRRUS_CLONE_DEPTH: 50
  519. matrix:
  520. QA_CATEGORY: Upgrade
  521. script:
  522. - ./private/cirrus/cirrus-qa.sh oracle12
  523. on_failure:
  524. <<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE
  525. # Software Composition Analysis (SCA): check potential vulnerabilities in dependencies.
  526. # Note that license compliance of dependencies is not checked for now.
  527. owasp_check_task:
  528. only_if: >-
  529. $CIRRUS_CRON == "nightly" ||
  530. $CIRRUS_CRON == "weekly-latest" ||
  531. $CIRRUS_CRON == "weekly-lts" ||
  532. changesInclude('private/owasp/*.xml')
  533. <<: *YARN_CACHE_TEMPLATE
  534. timeout_in: 30m
  535. gke_container:
  536. <<: *GKE_CONTAINER_TEMPLATE
  537. cpu: 1.7
  538. memory: 4Gb
  539. environment:
  540. # No need to clone the full history.
  541. # Depth of 1 is not enough because it would fail the build in case of consecutive pushes
  542. # (example of error: "Hard resetting to c968ecaf7a1942dacecd78480b3751ac74d53c33...Failed to force reset to c968ecaf7a1942dacecd78480b3751ac74d53c33: object not found!")
  543. CIRRUS_CLONE_DEPTH: 50
  544. SLACK_WEBHOOK_SQ: ENCRYPTED[dec8e4350cbea3b94d63098558bcb3ae9e79b71c2b6286fcfb9eb80c0953b6448b10f7271b07b5e75e52f362c25d7a8f]
  545. script:
  546. - gradle dependencyCheckAggregate
  547. on_failure:
  548. slack_notification_script:
  549. - ./private/cirrus/cirrus-owasp-notification.sh
  550. always:
  551. reports_artifacts:
  552. path: "build/reports/*"