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 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #
  2. # ENV VARIABLES
  3. #
  4. env:
  5. ### Shared variables
  6. CIRRUS_VAULT_AUTH_PATH: jwt-cirrusci
  7. CIRRUS_VAULT_ROLE: cirrusci-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}
  8. CIRRUS_VAULT_URL: https://vault.sonar.build:8200
  9. ARTIFACTORY_URL: VAULT[development/kv/data/repox data.url]
  10. ARTIFACTORY_PRIVATE_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader
  11. ARTIFACTORY_PRIVATE_PASSWORD: VAULT[development/artifactory/token/SonarSource-sonar-scanner-cli-private-reader access_token]
  12. ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/SonarSource-sonar-scanner-cli-private-reader access_token]
  13. ARTIFACTORY_DEPLOY_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer
  14. ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/SonarSource-sonar-scanner-cli-qa-deployer access_token]
  15. ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
  16. GCF_ACCESS_TOKEN: VAULT[development/kv/data/promote data.token]
  17. PROMOTE_URL: VAULT[development/kv/data/promote data.url]
  18. BURGR_URL: VAULT[development/kv/data/burgr data.url]
  19. BURGR_USERNAME: VAULT[development/kv/data/burgr data.cirrus_username]
  20. BURGR_PASSWORD: VAULT[development/kv/data/burgr data.cirrus_password]
  21. ### Project variables
  22. DEPLOY_PULL_REQUEST: true
  23. ARTIFACTS: org.sonarsource.scanner.cli:sonar-scanner-cli:jar
  24. NIGHTLY_CRON: 'nightly-cron'
  25. #
  26. # RE-USABLE CONFIGS
  27. #
  28. eks_container: &EKS_CONTAINER
  29. region: eu-central-1
  30. cluster_name: ${CIRRUS_CLUSTER_NAME}
  31. namespace: default
  32. image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-m3-latest
  33. cpu: 1
  34. memory: 4G
  35. ec2_instance: &EC2_INSTANCE_WINDOWS
  36. experimental: true # see https://github.com/cirruslabs/cirrus-ci-docs/issues/1051
  37. region: eu-central-1
  38. subnet_id: ${CIRRUS_AWS_SUBNET}
  39. type: t2.2xlarge
  40. image: base-windows-jdk17-v*
  41. platform: windows
  42. only_sonarsource_qa: &ONLY_SONARSOURCE_QA
  43. only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
  44. except_nightly_cron: &EXCEPT_ON_NIGHTLY_CRON
  45. only_if: $CIRRUS_CRON != $NIGHTLY_CRON
  46. #
  47. # TASKS
  48. #
  49. build_task:
  50. eks_container:
  51. <<: *EKS_CONTAINER
  52. env:
  53. SONAR_TOKEN: VAULT[development/kv/data/next data.token]
  54. SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
  55. SIGN_KEY: VAULT[development/kv/data/sign data.key]
  56. PGP_PASSPHRASE: VAULT[development/kv/data/sign data.passphrase]
  57. maven_cache:
  58. folder: ${CIRRUS_WORKING_DIR}/.m2/repository
  59. script:
  60. - source cirrus-env BUILD
  61. - regular_mvn_build_deploy_analyze -Pdist-linux,dist-windows,dist-macosx
  62. cleanup_before_cache_script:
  63. - cleanup_maven_repository
  64. linux_qa_java17_task:
  65. depends_on:
  66. - build
  67. <<: *ONLY_SONARSOURCE_QA
  68. eks_container:
  69. <<: *EKS_CONTAINER
  70. env:
  71. matrix:
  72. - SQ_VERSION: LATEST_RELEASE[9.9]
  73. - SQ_VERSION: DEV
  74. maven_cache:
  75. folder: ${CIRRUS_WORKING_DIR}/.m2/repository
  76. qa_script:
  77. - nodeVersion=18.17.0
  78. - nodeName=node-v${nodeVersion}-linux-x64
  79. - wget https://nodejs.org/download/release/v${nodeVersion}/${nodeName}.tar.gz
  80. - tar xzf ${nodeName}.tar.gz -C /tmp
  81. - export PATH=$PATH:/tmp/${nodeName}/bin
  82. - source cirrus-env QA
  83. - source set_maven_build_version $BUILD_NUMBER
  84. - cd it
  85. - mvn -B -e -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify
  86. cleanup_before_cache_script:
  87. - cleanup_maven_repository
  88. win_qa_java17_task:
  89. depends_on:
  90. - build
  91. <<: *ONLY_SONARSOURCE_QA
  92. ec2_instance:
  93. <<: *EC2_INSTANCE_WINDOWS
  94. env:
  95. CIRRUS_SHELL: bash
  96. matrix:
  97. - SQ_VERSION: LATEST_RELEASE[9.9]
  98. - SQ_VERSION: DEV
  99. maven_cache:
  100. folder: ${CIRRUS_WORKING_DIR}/.m2/repository
  101. qa_script:
  102. - source cirrus-env QA
  103. - source set_maven_build_version $BUILD_NUMBER
  104. - cd it
  105. - mvn -B -e -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify
  106. cleanup_before_cache_script:
  107. - cleanup_maven_repository
  108. promote_task:
  109. depends_on:
  110. - linux_qa_java17
  111. - win_qa_java17
  112. <<: *ONLY_SONARSOURCE_QA
  113. <<: *EXCEPT_ON_NIGHTLY_CRON
  114. eks_container:
  115. <<: *EKS_CONTAINER
  116. cpu: 0.5
  117. memory: 500M
  118. env:
  119. GITHUB_TOKEN: VAULT[development/github/token/SonarSource-sonar-scanner-cli-promotion token]
  120. maven_cache:
  121. folder: $CIRRUS_WORKING_DIR/.m2/repository
  122. script:
  123. - cirrus_promote_maven
  124. cleanup_before_cache_script:
  125. - cleanup_maven_repository