diff --git a/.cirrus.star b/.cirrus.star deleted file mode 100644 index 9f91e154..00000000 --- a/.cirrus.star +++ /dev/null @@ -1,4 +0,0 @@ -load("github.com/SonarSource/cirrus-modules@v3", "load_features") - -def main(ctx): - return load_features(ctx) diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index 6d62f9b4..00000000 --- a/.cirrus.yml +++ /dev/null @@ -1,70 +0,0 @@ -env: - ARTIFACTORY_URL: VAULT[development/kv/data/repox data.url] - ARTIFACTORY_PRIVATE_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader - ARTIFACTORY_PRIVATE_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token] - ARTIFACTORY_DEPLOY_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer - ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token] - - #Possible values for ARTIFACTORY_DEPLOY_REPO: sonarsource-private-qa, sonarsource-public-qa - ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa - ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token] - DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token] - DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN} - GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token] - # Allows to run builds for the 50 last commits in a branch: - CIRRUS_CLONE_DEPTH: 50 - ARTIFACTS: "\ - org.sonarsource.orchestrator:sonar-orchestrator:jar,\ - org.sonarsource.orchestrator:sonar-orchestrator-junit4:jar,\ - org.sonarsource.orchestrator:sonar-orchestrator-junit5:jar" - -eks_container_template: &EKS_CONTAINER_TEMPLATE - image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-m3-latest - cluster_name: ${CIRRUS_CLUSTER_NAME} - region: eu-central-1 - namespace: default - -only_sonarsource_qa: &ONLY_SONARSOURCE_QA - only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master") - -build_task: - eks_container: - <<: *EKS_CONTAINER_TEMPLATE - cpu: 4 - memory: 4G - env: - # analysis on next - SONAR_TOKEN: VAULT[development/kv/data/next data.token] - SONAR_HOST_URL: https://next.sonarqube.com/sonarqube - #allow deployment of pull request artifacts to repox - DEPLOY_PULL_REQUEST: true - SIGN_KEY: VAULT[development/kv/data/sign data.key] - PGP_PASSPHRASE: VAULT[development/kv/data/sign data.passphrase] - maven_cache: - folder: ${CIRRUS_WORKING_DIR}/.m2/repository - build_script: - - source cirrus-env BUILD - - regular_mvn_build_deploy_analyze - - ./check-license-compliance.sh - cleanup_before_cache_script: cleanup_maven_repository - on_failure: - reports_artifacts: - path: "**/build/reports/**/*" - -promote_task: - depends_on: - - build - <<: *ONLY_SONARSOURCE_QA - eks_container: - <<: *EKS_CONTAINER_TEMPLATE - cpu: 1 - memory: 1G - env: - GITHUB_TOKEN: VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promotion token] - ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token] - maven_cache: - folder: ${CIRRUS_WORKING_DIR}/.m2/repository - script: - - cirrus_promote_maven - cleanup_before_cache_script: - - cleanup_maven_repository diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..020e0ee6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +name: Build +on: + push: + branches: + - master + - branch-* + pull_request: + merge_group: + workflow_dispatch: + +jobs: + build: + concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }} + runs-on: ubuntu-24.04-large + name: Build + permissions: + id-token: write + contents: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: jdx/mise-action@bfb9fa0b029db830a8c570757cee683df207a6c5 # v2.4.0 + with: + version: 2025.7.12 + - uses: SonarSource/ci-github-actions/get-build-number@v1 + - uses: SonarSource/ci-github-actions/build-maven@v1 + env: + DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${{ env.DEVELOCITY_TOKEN }} + with: + deploy-pull-request: true + artifactory-reader-role: private-reader + artifactory-deployer-role: qa-deployer + use-develocity: true + - name: Check license compliance + run: ./check-license-compliance.sh + + promote: + needs: [build] + concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }} + runs-on: ubuntu-24.04-large + name: Promote + permissions: + id-token: write + contents: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: jdx/mise-action@bfb9fa0b029db830a8c570757cee683df207a6c5 # v2.4.0 + with: + cache_save: false + version: 2025.7.12 + - uses: SonarSource/ci-github-actions/get-build-number@v1 + - uses: SonarSource/ci-github-actions/promote@v1 + with: + promote-pull-request: true diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..e99a17cc --- /dev/null +++ b/mise.toml @@ -0,0 +1,4 @@ +[tools] +java = "21.0" +maven = "3.9" + diff --git a/sonar-orchestrator/src/main/java/com/sonar/orchestrator/locator/ArtifactoryFactory.java b/sonar-orchestrator/src/main/java/com/sonar/orchestrator/locator/ArtifactoryFactory.java index 4a7eba24..4ede1153 100644 --- a/sonar-orchestrator/src/main/java/com/sonar/orchestrator/locator/ArtifactoryFactory.java +++ b/sonar-orchestrator/src/main/java/com/sonar/orchestrator/locator/ArtifactoryFactory.java @@ -27,7 +27,7 @@ public class ArtifactoryFactory { private static final String DEFAULT_ARTIFACTORY_PREFIX = "https://repox.jfrog.io"; - private static final String DEFAULT_ARTIFACTORY_URL = DEFAULT_ARTIFACTORY_PREFIX + "/repox"; + private static final String DEFAULT_ARTIFACTORY_URL = DEFAULT_ARTIFACTORY_PREFIX + "/artifactory"; /** * Two types of Artifactory are supported: Maven and Default. diff --git a/sonar-orchestrator/src/test/java/com/sonar/orchestrator/locator/ArtifactoryFactoryTest.java b/sonar-orchestrator/src/test/java/com/sonar/orchestrator/locator/ArtifactoryFactoryTest.java index 5716f98a..21cdec75 100644 --- a/sonar-orchestrator/src/test/java/com/sonar/orchestrator/locator/ArtifactoryFactoryTest.java +++ b/sonar-orchestrator/src/test/java/com/sonar/orchestrator/locator/ArtifactoryFactoryTest.java @@ -32,7 +32,7 @@ class ArtifactoryFactoryTest { - private static final String DEFAULT_REPOSITORY = "https://repox.jfrog.io/repox"; + private static final String DEFAULT_REPOSITORY = "https://repox.jfrog.io/artifactory"; private static final String SOME_MAVEN_REPOSITORY = "https://localhost:9000/maven-repo"; private static final String ACCESS_TOKEN = "access_token"; private static final String API_KEY = "api_key";