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

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