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

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