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.

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. ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token]
  17. BURGR_URL: VAULT[development/kv/data/burgr data.url]
  18. BURGR_USERNAME: VAULT[development/kv/data/burgr data.cirrus_username]
  19. BURGR_PASSWORD: VAULT[development/kv/data/burgr data.cirrus_password]
  20. ### Project variables
  21. DEPLOY_PULL_REQUEST: true
  22. ARTIFACTS: org.sonarsource.scanner.cli:sonar-scanner-cli:jar
  23. NIGHTLY_CRON: 'nightly-cron'
  24. #
  25. # RE-USABLE CONFIGS
  26. #
  27. eks_container: &EKS_CONTAINER
  28. region: eu-central-1
  29. cluster_name: ${CIRRUS_CLUSTER_NAME}
  30. namespace: default
  31. image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-m3-latest
  32. cpu: 1
  33. memory: 4G
  34. ec2_instance: &EC2_INSTANCE_WINDOWS
  35. experimental: true # see https://github.com/cirruslabs/cirrus-ci-docs/issues/1051
  36. region: eu-central-1
  37. subnet_id: ${CIRRUS_AWS_SUBNET}
  38. type: t2.2xlarge
  39. image: base-windows-jdk17-v*
  40. platform: windows
  41. only_sonarsource_qa: &ONLY_SONARSOURCE_QA
  42. only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
  43. except_nightly_cron: &EXCEPT_ON_NIGHTLY_CRON
  44. only_if: $CIRRUS_CRON != $NIGHTLY_CRON
  45. #
  46. # TASKS
  47. #
  48. build_task:
  49. eks_container:
  50. <<: *EKS_CONTAINER
  51. env:
  52. SONAR_TOKEN: VAULT[development/kv/data/next data.token]
  53. SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
  54. SIGN_KEY: VAULT[development/kv/data/sign data.key]
  55. PGP_PASSPHRASE: VAULT[development/kv/data/sign data.passphrase]
  56. maven_cache:
  57. folder: ${CIRRUS_WORKING_DIR}/.m2/repository
  58. script:
  59. - source cirrus-env BUILD
  60. - regular_mvn_build_deploy_analyze -Pdist-linux,dist-windows,dist-macosx
  61. cleanup_before_cache_script:
  62. - cleanup_maven_repository
  63. linux_qa_java17_task:
  64. depends_on:
  65. - build
  66. <<: *ONLY_SONARSOURCE_QA
  67. eks_container:
  68. <<: *EKS_CONTAINER
  69. env:
  70. matrix:
  71. - SQ_VERSION: LATEST_RELEASE[9.9]
  72. - SQ_VERSION: LATEST_RELEASE
  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: LATEST_RELEASE
  99. - SQ_VERSION: DEV
  100. maven_cache:
  101. folder: ${CIRRUS_WORKING_DIR}/.m2/repository
  102. qa_script:
  103. - source cirrus-env QA
  104. - source set_maven_build_version $BUILD_NUMBER
  105. - cd it
  106. - mvn -B -e -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify
  107. cleanup_before_cache_script:
  108. - cleanup_maven_repository
  109. promote_task:
  110. depends_on:
  111. - linux_qa_java17
  112. - win_qa_java17
  113. <<: *ONLY_SONARSOURCE_QA
  114. <<: *EXCEPT_ON_NIGHTLY_CRON
  115. eks_container:
  116. <<: *EKS_CONTAINER
  117. cpu: 0.5
  118. memory: 500M
  119. env:
  120. GITHUB_TOKEN: VAULT[development/github/token/SonarSource-sonar-scanner-cli-promotion token]
  121. maven_cache:
  122. folder: $CIRRUS_WORKING_DIR/.m2/repository
  123. script:
  124. - cirrus_promote_maven
  125. cleanup_before_cache_script:
  126. - cleanup_maven_repository